# Puzzle with sums and powers

If the sum of the digits of 77^77 is S, and the sum of the digits of S is T, find the sum of the digits of T.

## Computational solution

Python says (since wasn't applied):

$77^{77}=$18188037387806198379277339915556929647807403283187048631478337739929618787870634227045716719924575689062274471430368865388203540672666042530996797
$S=722$
$T=11$
$\text{Sum of digits of T }=2$

## Manual solution

First:

$77^{77}<100^{100}$, so the digit sum ($S$) is at most $1800$. But then the digit sum of that ($T$) is at most $27$. Let $U$ be the digit sum of $T$, then $U$ is at most $10$.

Also:

$77\equiv5\text{ (mod }9\text)$. In $\text{mod }9$, the powers of $5$ go $5,7,8,4,2,1,5,7,8,4,2,1,\dots$ and so since this cycle is of length $6$ and $77\equiv5\text{ (mod }6\text)$, $77^{77}\equiv2\text{ (mod }9\text)$ (the second last term in the cycle). It is well known that the digit sum is equivalent to the original sum $\text{(mod }9\text)$, so $U\equiv T\equiv S\equiv2\text{ (mod }9\text)$ as well.

So $U$ is:

$2$, since that is the only number $\leq10$ that is $\equiv2\text{ (mod }9\text)$

• The question asked for the sum of digits of T, not T. – ffao Sep 21 '17 at 1:41
• @ffao I should lose 100 reputation each time I don't read the question carefully, maybe that would teach me to read things through. – boboquack Sep 21 '17 at 2:40