# Pattern in Squared Numbers and their Digit Sum

So this has been boggling my mind for some time now. On spring break I was really bored and started messing around with numbers when I noticed something. I was squaring each number (1-9) when I realized I could get the products down to a single digit using the digit sum.
1^2=1 | 1^3=1 | 1^4=1...
2^2=4 | 2^3=8 | 2^4=16=1+6=7...
3^2=9 | 3^3=27=2+7=9...
4^2=16=1+6=7...
5^2=25=2+5=7...
6^2=36=3+6=9...
7^2=49=4+9=13=1+3=4...
8^2=64=6+4=10=1...
9^2=81=8+1=9...
So on and so forth. I realized there was many patterns were emerging.
X |x^2|x^3|x^4|x^5|x^6|x^7
1 = 1 | 1 | 1 | 1 | 1 | 1 | 1
2 = 2 | 4 | 8 | 7 | 5 | 1 | 2 | 4 | 8 | 7 | 5
3 = 3 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9
4 = 4 | 7 | 1 | 4 | 7 | 1 | 4 | 7 | 1 | 4 | 7
5 = 5 | 7 | 8 | 4 | 2 | 1 | 5 | 7 | 8 | 4 | 2
6 = 6 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9
7 = 7 | 4 | 1 | 7 | 4 | 1 | 7 | 4 | 1 | 7 | 4
8 = 8 | 1 | 8 | 1 | 8 | 1 | 8 | 1 | 8 | 1 | 8
9 = 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9
• The repeated application of the digit sum of a number will yield what the remainder of the original number is when divided by nine. What you have in effect discovered is the ring $(\mathbb{Z}_9,+,\times)$ and in particular the multiplicative group $(\mathbb{Z}_9^*, \times)$. – JMoravitz May 16 at 14:59
When you take the repeated digit sum you are finding the remainder on division by $$9$$ except you are getting $$9$$ instead of $$0$$. This is the classic divisibility test for $$9$$. When you take the powers, you are effectively doing that $$\bmod 9$$. That shows why you get stuck with $$3,6,9.$$ Once you square it you have two factors of $$3$$ and every successive power is also divisible by $$9$$. $$\bmod 9$$ we have $$8 \equiv -1$$, so when you square $$8$$ you get $$1$$, then another multiply gets $$8$$ and so on.
The numbers coprime to $$9$$, of which there are $$\phi(9)=6,$$ form a multiplcative group. Each one will cycle with a period that divides into $$6$$.