<s>[INST] How to use prove this $p^4\equiv p\pmod {13}$ 
Let a prime number $p$, and $n$ a positive integer such $$p\mid n^4+n^3+2n^2-4n+3.$$
Show that $$p^4\equiv p\pmod {13}.$$

A friend of mine suggested that I might be able to use the results problem.
 [/INST] Proof for the case when $n\bmod 13 \neq 3$
Let $n\bmod 13 = k$. Then, by substituting $k=0,1,\ldots,12$ and $k\neq 3$, we have
$$\left[n^4+n^3+2n^2-4n+3\right]\bmod 13= \left[k^4+k^3+2k^2-4k+3\right]\bmod 13\in\{1,3,9\},$$
which are all  powers of $3$. Now, notice that $$n^4+n^3+2n^2-4n+3\bmod p=0\implies p\bmod 13 \in\{ 1,3, 9\},\tag{1}$$
since  $p\bmod 13\neq 0$ as $p$ is a prime number. 
Finally, we deduce that
\begin{align}
p^4\bmod 13&=\left[p^4-p + p\right]\bmod 13\\
&=\left[p(p-1)(p^2+p+1)+ p\right]\bmod 13\\
&=\left[p(p-1)(p^2+p-12) + p\right]\bmod 13\\
&= \left[p(p-1)(p-3)(p+4)+ p\right]\bmod 13\\
&=\left[p(p-1)(p-3)(p-9)+ p\right]\bmod 13 \\
&= p\bmod 13.
\end{align}
where we use $(1)$. 
</s>