# What is the remainder when $N = (1! + 2! + 3! + 4! + … + 1000! )^{40}$ is divided by $10?$

What is the remainder when $N = (1! + 2! + 3! + 4! + ........... + 1000! )^{40}$ is divided by $10$ ?

My try:

On watching the pattern as it grows, after $4!$ all are divisible by $10$.

So, infact I am just left with $N = (1! + 2! + 3! + 4! + 0)^{40}$ and I need to check the remainder when this $N$ is divisible by $10$.

Hence, the $N$ sums up to $33^{40}$ when divided by $10$ .

Now, after this I can simply apply Euler's Theorem such that

$33^{4} = 1 (mod 10)$

After all, the remainder comes out to be $1$.

I don't have an answer for this. Is my understanding right or did I miss something?

• $33=3\bmod{10}$ and $3^2=-1\bmod{10}$ hence $3^{12}=(-1)^4=1\bmod{10}$ and $33^{12}=3^{12}=1\bmod{10}$ – Did Dec 29 '16 at 18:07
• @Did, So, 1 is right ? – Jon Garrick Dec 29 '16 at 18:08
• One issue, $33^9 \not\equiv 1 \bmod 10$ - the exponent you are looking for is $\phi(10)=4$ because $10$ is not prime (and so it's Euler's theorem not Fermat's Little Theorem). But the answer comes out as $1$ (even more simply), nevertheless. – Joffan Dec 29 '16 at 18:15
• "I guess after 4! all are divisible by 10." Don't guess. Know. If $n \ge 5$ then $5|n!$ and $2|n!$ so $10|n!$. No guessing at all. – fleablood Dec 29 '16 at 18:17
• @fleablood See previous comment. (Aren't you coming a little late?) – Did Dec 29 '16 at 18:32

1. Note that you can reduce $33$ to just $3$
2. Euler's theorem says that $3^{4}\equiv 1\pmod{10}$
• Sorry, That was a typo :) – Jon Garrick Dec 29 '16 at 18:10
• Euler's theorem also says that $\gcd(33,10)=1\implies33^{\phi(10)}\equiv1\pmod{10}\implies33^4\equiv1\pmod{10}$ – barak manos Dec 30 '16 at 15:40
• @barakmanos After applying 1., that is exactly what 2. says in my answer. – Arthur Dec 30 '16 at 16:40
• What I meant to say is that you could get rid of #1 and still use Euler's theorem as is. – barak manos Dec 30 '16 at 18:23
• @barakmanos That is true. But why would you not want to reduce modulo $10$ when that's so easy to do? – Arthur Dec 30 '16 at 18:28

Go to the basics.

Let $(1! + 2! + 3! + 4! ........+ 1000!)=x$.

Now it is clear that unit digit of $x$ will be $3$. (Why??)

Also, If a number is divided by $10$, the remainder is the unit digit.

let us see what will be the unit digit of $x^{40}$.

Notice that unit digits of powers of $3$ get repeated in pattern, as $3^0=1, 3^1=3, 3^2=9, 3^3=27$. Follow this pattern and you will find that unit digit of something like, $3^{40}$ will be $1$. I shall let you conclude now.