<s>[INST] Find the smallest prime number $p$ such that $p\, | \,n^2-n-2023$ for some integer $n$. Find the smallest prime number $p$ such that $p\, | \,n^2-n-2023$ for some integer $n$.
since $n^2-n =n(n-1)$ is the product of two consecutive integers they must be even so the difference between an even and odd number is always odd so $n^2-n-2023$ is always odd which implies $p$ is not even and the only even prime is $2$ so $p\neq 2$  but after this I do not know what to do please help.
 [/INST] Note that $2023 = 7 \cdot 17^2$
$p=3$
\begin{align}
   n^2-n-2023 \equiv 0 \pmod 3 \\
   n^2+2n-1 \equiv 0 \pmod 3 \\
   (n+1)^2 \equiv 2 \pmod 3
\end{align}
\begin{array}{|c|cc|}
\hline
  n \mod 3 & 0 & 1,2 \\
n^2 \mod 3 & 0 & 1  \\
\hline
\end{array}
The perfect squares modulo $3$ are $0$ and $1$. So there is no solution.
$p=5$
\begin{align}
   n^2-n-2023 &\equiv 0 \pmod 5 \\
   n^2+4n+2    &\equiv 0 \pmod 5 \\
   (n+2)^2+3  &\equiv 0 \pmod 5 \\
   (n+2)^2    &\equiv 2 \pmod 5
\end{align}
\begin{array}{|c|ccc|}
\hline
  n \mod 5 & 0 & 1,4 & 2,3 \\
n^2 \mod 5 & 0 &  1   & 4  \\
\hline
\end{array}
The perfect squares modulo $5$ are $0, 1, 4$. So there is no solution.
$p=7$
\begin{align}
   n^2-n-2023 &\equiv 0 \pmod 7 \\
   n^2-n      &\equiv 0 \pmod 7 \\
   n(n-1)     &\equiv 0 \pmod 7 \\
\end{align}
Clearly $n \equiv 0 \pmod 7$ and $n \equiv 1 \pmod 7$ are solutions.
</s>