The question is already mentioned in the title: For which odd number n does 503 divide $n^2+1$
$503\cdot q=n^2+1$
The question is already mentioned in the title: For which odd number n does 503 divide $n^2+1$
$503\cdot q=n^2+1$
$503$ is a prime of the form $4k+3$ hence there is no integer $n$ such that $503$ divides $n^2+1$
Let $p=4k+3$ And assume that there is some integer $n$ such that $n^2\equiv -1 \mod p$ then we have $n^{p-1}\equiv (n^2)^{\frac{p-1}{2}}\equiv (-1)^{\frac{p-1}{2}}\equiv (-1)^{2k+1}\equiv -1 \mod p$
now using Fermat's little theorem we have $n^{p-1}\equiv 1 \mod p$ which is a contradiction.