Solving for the smallest $x$ : $1! + 2! + \cdots+ 20! \equiv x\pmod 7$ I know the smallest $x \in \mathbb{N}$, satisfying $1! + 2! + \cdots + 20! \equiv x\pmod7$ is $5$. I would like to know methods to get to the answer.

Note that each of $7!$, $8!$, $9!,\ldots, 20!$ is congruent to $0$ modulo $7$, since they are all divisible by $7$.
Note that $6!\equiv -1\pmod{7}$ by Wilson's Theorem, which cancels $1!$. 
That leaves $2!+3!+4!+5! = 2! + 3!(1 + 4 + 20)$. But $3!\equiv -1\pmod{7}$, and $20\equiv -1\pmod{7}$, so $2!+3!+4!+5! \equiv 2-(1+4-1) = -2\equiv 5\pmod{7}$.
