<s>[INST] Determine all prime numbers a,b,c for which the expression $a^2+b^2+c^2-1$ is a perfect square Determine all prime numbers a,b,c for which the expression $a^2+b^2+c^2-1$ is a perfect square
My approach : we know that $(a+b+c)^2 = a^2+b^2+c^2 +2ab+2bc+2ca$
$\Rightarrow $ the given equation to be a perfect square means $2ab+2bc+2ca =-1$
Is this approach correct, please guide how to take it further.. will be of great help thanks.
 [/INST] Modulo $4$ all squares are $0$ or $1$. If all of $a,b,c$ are odd primes (not $2$) we have $a^2+b^2+c^2-1\equiv2\bmod4$, which is a contradiction. For similar reasons we cannot have all three of $a,b,c$ being $2$, so there must be one or two $2$'s (which we will assign by default to the earliest variables in alphabetical order). If two, we have $7+c^2=d^2$ with the only solution being $c=3$ (and $d=4$).
It remains to check the one-$2$ case. plop's comment rules out the $b,c>3$ case, so we are left with $a=2$, $b=3$ and the equation $12+c^2=d^2$, whose only solution is $c=2$ – but this is the same as the previous considered case up to variable reordering.
Hence the only solutions to $a^2+b^2+c^2-1=d^2$ with $a,b,c$ primes are $\{a,b,c\}=\{2,2,3\}$.
</s>