<pre>
Amazingly, the answer can be found with a normal calculator.  Let X be
4444^4444, and Y = sod(sod(sod(X))).

<pre>
 Let's calculate Y's remainder upon division by 9.  It is a well-known fact
</pre>
that n <code></code> sod(n) (mod 9) for all positive numbers.  Therefore, Y <code></code> X (mod
9).  4444 <code></code> 7 (mod 9), so Y <code></code> X <code></code> 7^4444 (mod 9).  We also discover that
7^3 <code></code> 1 (mod 9), so 7^4444 <code> 7 * (7^3)^1481 </code>= 7 (mod 9).  Therefore,

<pre>
 Y <code></code> 7 (mod 9) (*)
</pre>

Furthermore,

<pre>
 X < 10000^4444 <code> (10^4)^4444 </code> 10^(4*4444) = 10^17776.
</pre>

Of all numbers less than 10^17776, the one with the highest total digital
sum is 10^17776-1, i.e. 17776 9's.  Therefore, sod(X) <<code> 9 * 17776 </code>
159984.  Similarly, sod(sod(X)) <<code> sod(99999) </code> 45, and we do it again to get:

<pre>
 Y <<code> sod(39) </code> 12  ('''''')
</pre>

The only positive number that satisfies both (''') and ('''*) is 7, so
sod(sod(sod(4444^4444))) = 7.

Matthew Daly
mwdaly@kodak.com
</pre>
