Number Theory – Remainder of Sum of Factorials Divided by 7

number theory

what is the remainder when 1!+2!+3!+4!+⋯+49! is divided by 7?

MyApproch:

By taking individual numbers as ($1$!+$2$!+$3$!+$4$!+⋯+$49$!)/$7$

I get $1$+$2$+$6$+$3$+$1$+$6$+$0$+$0$…..=$19$/$7$=$5$

But the approach will be too long.I am not able to figure out any other way

Can anyone guide me how to approach the problem?

Best Answer

For $k \geq 7$, we have $$7\; \vert\; k!.$$ Hence $$\sum_{k=1}^{49} k! = 1!+2!+3!+4!+5!+6!\equiv1+2+(-1)+3+1+(-1)\equiv5 \pmod{7}.$$