# Squares of sum of digits of a number part 2

This is a sequel to my previous question which was this Squares of sum of digits of a number For those new I will give some context. Take a number then add up it's digits and square them then repeat this process and in the end you will get either 1,81,169,256. For proof and more information you can click on the link.

Now if I want to know after how many steps the sequence terminates that is after how many steps we get 1,81,169 or 256 for the first time, how do I proceed?

• See OEIS sequence A177148. That's not quite what you wanted, because it's the number of steps to reach the end of the cycle, not the start, so you want to subtract $1$ from $A177148(n)$ if you end in the $2$-cycle. Anyway, it's unlikely there's a closed form for this. Commented Apr 9 at 3:18
• @RobertIsrael but does that give a formula where we plug in the value of n and it tells us about the number of steps Commented Apr 9 at 12:54
• No, as I said, a formula is unlikely to exist. Commented Apr 9 at 15:39