A false conjecture by Goldbach In 1752 Goldbach send this conjecture to Euler: "Every odd integer can be written in the form $p+2a^2$ where $p$ is a prime or $1$ and $a$ is a natural number (can be even 0)." This conjecture turned out to be false and my book asks me to prove that $5777$ cannot be written in such manner. 
What I did is simply noted that if exists such $p$ it must be of the form $5777-2a^2$ and so $a$ mustn't be greater than $53$. Then I simply checked that for every values of $a$ from $0$ to $53$ $p$ is not prime.
Btw this is a very tedious way to prove this and may in a test I wouldn't be able to do this so I was wondering if there was any shorter way? (or my book just wanted me to make a lot of calculations for some reason.) 
 A: At first we assume that $3\nmid a$. Then $a$ is one of the forms $3k\pm1$
Assume that \begin{align} 5777 &=p+2a^2\\
i.e  \quad 5777 &=p+2(3k\pm1)^2\\
i.e \quad   p&= 3(1925-6x^2\pm4x)\\
\end{align}
Since $p$ is a prime and $3|p$, so $p=3$.
Thus \begin{align} 5777 &=p+2a^2\\
\implies a^2&=2887
\end{align}
which is not a perfect square. This shows that $5777$ cannot be in the form $3k\pm1$.
We now assume that $3|a$ which causes $a$ to be in the form $3q$.
Now \begin{align} 5777 &=p+2a^2\\
\implies 5777&= p+18q^2\\
\implies p&\equiv 5777\quad  (mod \quad 18)\\
\implies p&\equiv 17\quad (mod\quad 18)\\
\end{align}
But $17$ and $18$ are relatively prime and hence $18\nmid p$.
The above congruence only holds for $p=17$ but for $p=17$
$5777  =17+2a^2\implies a^2=2880$ which is not an integer.
So this case also fails.
This follows the desired result.
A: Observe that $5777\equiv 2\pmod 3$ and $2a^2\equiv 2\pmod 3$ unless $3\mid a$. Hence once you check that $5777-3$ is not twice a square, you need only check $a$ with $3\mid a$ (cutting down the effort by two thirds).
Likewise, $5777\equiv 2\pmod 5$, which allows you to drop all cases where $a\equiv \pm1\pmod 5$ (after checking that $5777-5$ is not twice a square).
A: Say $p = 5777 - 2a^2$.
Now, if $a \equiv 1,2 \mod 3$ then $p$ is divisible by $3$, which is impossible as we can check that $p \neq 3$.
If $a \equiv 0 \mod 3$ then $p \equiv 17 \mod 18$, so it is sufficient to only check a few values for $p$.
