# Show that if $n\geq 5$ then $1!+2!+3!+\ldots+n!\equiv 3 \pmod{5}$

Show that if $n\geq 5$ then $1!+2!+3!+\ldots+n!\equiv 3\pmod{5}$ I found this problem in Legendre Symbol Section, but I can't find relationship between $n!$ between factorial and Legendre Symbol. Anyone can give a hint or some part of proof?

• Hint: What is $n!\pmod{5}$ for any $n\geq 5$? (Is $5$ a multiple of $n!$ for $n\geq 5$?) What terms actually contribute then to the sum modulo five? – JMoravitz Sep 22 '16 at 6:58
• @JMoravitz means: Is $n!$ a multiple of $5$ for $n\ge5$. – Did Sep 22 '16 at 7:05

We have that for $n\geq 5$ then $$1!+2!+3!+4!+5!+\dots +n!=33+5\cdot(4!+\dots +(n!/5))\equiv 33\equiv 3\pmod{5}.$$ Note that for $n\geq 5$, the number $(4!+\dots +(n!/5))$ is an integer because $5$ divides $k!$ for $5\leq k\leq n$.

Hint: $n!\equiv 0 \pmod{5}$ for all $n\ge 5$.

Hint: you don't need the Legendre symbol. Note that from $5!$ all factorials are multiple of $10$ and $$\sum_{k=1}^{4}k!=33.$$

Hint:

\begin{align} (&1! &+ &2! &+ &3! &+ &\ldots &+ &n!) &\bmod &5 = \\ =\Big((&1! \bmod 5) &+ (&2! \bmod 5) &+ (&3! \bmod 5) &+ &\ldots &+ (&n! \bmod 5)\Big) &\bmod &5 \end{align}

Calculate first few terms and see what happens.

I hope this helps $\ddot\smile$