A natural number $n\ge5$ leaves the remainder $2$ when divided by $3$. Prove that the square of $n$ is not a sum of a prime number and a perfect square.
Problem
Source: Moldova 2000 Grade 7 P6
Tags: number theory
23.04.2021 16:24
14=13+1^2...
23.04.2021 16:35
$14$ isn't a square of an $n$ such that $5\le n\equiv2\pmod3$.
23.04.2021 16:47
Let $n^2 = k^2 + p$. Then $(n+k)(n-k) = p$ which forces $n - k = 1 \implies k=n-1$. So, we get that $2n - 1 = p$. But $2n - 1 \equiv 2(2) - 1 = 0 \pmod 3$ which is not possible since its supposed to be prime. The only possibility is if $p = 3$ but this means that $n = 2$, which is not possible since $n \ge 5$
23.04.2021 16:47
It turns out I can't read. We require $n^2=p+k^2$. Rearranging gives $(n+k)(n-k)=p$, so we need $n-k=1$ and $n+k=p$, hence $2n=p+1$. Hence $3 \mid p$ by taking mod 3, which implies $p=3$. Then we just need to check $n-k=1,n+k=3$ doesn't have solutions for $n \geq 5$ which is clear.