My problem is the following: given that I know what $k^n$ is, where $n,k \in \mathbb{N}$, find the sum of digits of $k^{n+1}$. For clarification: $S_{k, n}$ gives the sum of the digits of $k^{n}$.
What I've come up with so far is the following, using the modulo operation $\%$:
$$S_{k, n+1} = \sum_{i=1}^{\left \lceil \log k^n \right \rceil} \Big(k \left \lfloor \frac{k^n \ \% \ 10^i }{10^{i-1}} \right \rfloor \ \% \ 10\Big) +\sum_{i=1}^{\left \lceil \log k^n \right \rceil} \left \lfloor \frac{k}{10}\left \lfloor \frac{k^n \ \% \ 10^i }{10^{i-1}} \right \rfloor \right \rfloor$$
Where $\left \lfloor \frac{k^n \ \% \ 10^i }{10^{i-1}} \right \rfloor$ is a specific digit $d_i$ in $k^n$, e.g. $k =5,n=7 \Rightarrow$ $k^n = 5^7 = 78125$, here $d_1 = 5, d_2=2, d_3=1, d_4=8, d_5=7$
My question is: could anybody help me make sense of/simplify those sums in $S_{k,n+1}$? Because I have no idea where to begin.
This is all bathroom thinking so any help is appreciated.