Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are the last four digits of the following sum:

$$S=9+9^2+9^3+\ldots+9^{400} ?$$

share|cite|improve this question
No attempt at the answer?? – Epictetus Dec 3 '12 at 10:58
up vote 7 down vote accepted

Hint: This is a geometric sum, you can sum it and then do mod $10000$ to get the last $4$ digits

share|cite|improve this answer
mod 10000? [spacefiller] – akkkk Dec 3 '12 at 11:07
@akkkk - thanks, updated – Belgi Dec 3 '12 at 11:17

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)$?

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.