Sum of Digit squares

715 Views Asked by At

I like to create problems for myself, While playing with my calculator, I found the following result. Take any positive digit $a_0$, and let $a_n$ denote the sum of digit squares of $a_{n-1}$. Then there exists a $k$ such that $a_k=1$ or $4$.

(For a single digit number,$n$ take, $0^2+n^2$). I am not sure the result is true or false in general.

For example($a_0 = 679$)

$a_1=6^2+7^2+9^2=166$

$a_2=1^2+6^2+6^2=73$

$a_3=7^2+3^2=58$

$a_4=5^2+8^2=89$

$a_5=8^2+9^2=145$

$a_6=1^2+4^2+5^2=42$

$a_7=4^2+2^2=20$

$a_8=2^2+0^2=4$

Example 2($a_0=30$)

$a_1=3^2+0^2=9$

$a_2=0^2+9^2=81$

$a_3=8^2+1^2=65$

$a_4=6^2+5^2=61$

$a_5=6^2+1^2=37$

$a_6=3^2+7^2=58$

the rest is same

Even if the general result isn't true I would like to ask, why do most of the numbers behave this way?

1

There are 1 best solutions below

0
On BEST ANSWER

I believe this question can be solved as a combination of brute force and mathematics. It is simple to verify that your conjecture holds for $a_0<1000$ using a simple program, for example (written in Python):

for curr in range(1,1000):
    s = set()
    while True:
        ints = [int(j)*int(j) for j in str(curr)]
        curr = sum(ints)
        if curr in s:
            if 1 not in s and 4 not in s:
                return False
            break
        s.add(curr)
return True

Now all you have to show is that for any starting integer $a_0$, there exists such a $k$ that $a_k <1000$. This is simple to show since for $a_n>1000$, you can show that $a_{n+1} < a_n$:

Let $k$ be the number of digits of $a_n$. Then it is clear that $a_n>100k$, while on the other hand you know that $$a_{n+1} \leq 9^2+9^2+\dots+9^2=k\cdot 9^2\leq 100k<a_n.$$

NOTE: the inequalities I used are quite rough (meaning the proof could be made much more elegant), but they do work.