Prove/Disprove $ \sum_{i=1}^{p-1} (i!)^2 \not\equiv 0 (\text{mod } p)$.

modulesprime numbersproof-writing

Prove/Disprove $\displaystyle \sum_{i=1}^{p-1} (i!)^2 \not\equiv 0 (\text{mod } p)$.

While I was trying this problem, I had to show that $\displaystyle p \not\Bigg|\sum_{i=1}^{p-1} (i!)^2$. So I tried to solve this but failed.
Here's my attempt.

\begin{align}
& \text{Approach 1. What's }[i!(p-1-i)!]^2 \text{ mod } p?\\
\ \\
& \text{Note. } {p-1 \choose i}^2 \equiv 1 (\text{mod } p). \\
\Rightarrow \; & \left[ \frac {(p-1)!} {i!(p-1-i)!} \right]^2 \equiv 1 (\text{mod }p). \\
& \text{By Wilson's theorem, } (p-1)! \equiv -1 (\text{mod } p). \\
\therefore \; & \left[i!(p-1-i)!\right]^2 \equiv 1 (\text{mod } p). \\
\ \\
& \text{Approach 2. How can } 2\sum_{i=1}^{p-1} (i!)^2 \text{ change its form?} \\
&2\sum_{i=1}^{p-1} (i!)^2 = \sum_{i=1}^{p-1} \left\{(i!)^2+[(p-i)!]^2\right\}\\
& = \sum_{i=1}^{p-1} \left\{ [i!+(p-i)!]^2 -2\cdot i!(p-i)!\right\}
\end{align}

Uh… Any tips?

Best Answer

It seems that the statement is wrong. According to an answer here the smallest counterexample is $p=1248829$