What are the last four digits of the following sum:
$S=9+9^2+9^3+\ldots+9^{400} ?$
What are the last four digits of the following sum:
$S=9+9^2+9^3+\ldots+9^{400} ?$
Hint: This is a geometric sum, you can sum it and then do mod $10000$ to get the last $4$ digits
HINT 2: Use Euler's Theorem: if $a$ and $m$ are coprime, we have $a^n\equiv a^{n \text{ mod }\varphi(m)} \text{ mod }m$, where $\varphi$ is Euler's totient function. What is $\varphi(10000)$?