Digit sum of a huge number I am helping a high school student to solve some challenging problems. I am stuck on the following problem: let $S(n)$ be a digit sum of the integer $n$, e.g. $S(1234)=10$. Find $S(S(S(S(2018^{2018}))))$.
I spent some time on this problem but was not able to solve it. I found out, that the result should be less than $10$, since the number of digits in a number $n$ is $[\log_{10}n]+1$, where $[]$ denotes rounding towards zero. But this is not really helpful, since I need the precise number as an answer, not just an estimate.
I've tried to find some iteration relatioship, e.g. what is $S(n\cdot m)$, but it didn't help either. 
Hints are appreciated.
Thanks,
Mikhail 

For any positive integer $a$, $S(a)$ and $a$ have the same remainder on division by $9$.
Considering $2018^{2018}\bmod 9$, we have $2018\equiv 2\bmod 9$ and $2^6\equiv 1\bmod 9$. So $2018^{2018}\equiv 2^{2018}\equiv 1^{336}\cdot 2^2\equiv 4\bmod 9$.
Then since  $2018^2<10^7,  $ the number of digits in $E:= 2018^{2018}$ is less than $2018\cdot 7/2+1 < 8000$, so $S(E)< 9\cdot 8000 = 72000,$ $S(S(E)) \le 42,$ and $S(S(S(E)))) \le 12$
So you have more function iterations than you strictly need, but since $S(S(S(S(E))))<10$ we know that $S(S(S(S(2018^{2018}))))=4$
