I plan to determine the squared digit length of an integer.
You take an integer (e.g.29( and add up the squares of its digits. This will give u another integer. I want to repeat this process using loops until i end up with a 1 or a 4. the squared digit length is the number of times this process has to be repeated before it gets to 1 or 4.
for example, if we start with 29, we get:
2^2 + 9^2=85
8^2 + 5^2=89
8^2 + 9^2=145
1^2 + 4^2 + 5^2=42
4^2 + 2^2=20
2^2 + 0^2=4
this process shows that the squared digit length of 29 is 6.
my problem is that i don't know how to take out digits in an integer.
does anyone know the solution to the problem above?