About sum of three squares I am trying to find those $k$ for which the expression $1+(10k+4)^2 +(10m+8)^2$ is never a square number for any $m$.
Thank you!
 A: Following the suggestion of Greg Martin's answer, I tried several cases, and it always worked out that taking $n-p=1$ and $n+p=J$ always led to a solution in which $p=10m+8$.
Then running through the computation symbolically, if one defines $m=5k^2+4k$, then we have the identity
$$1+(10k+4)^2+(10m+8)^2=(10m+9)^2, \tag{1}$$
so that in answer to your question there are no values of $k$ for which your expression is never a square for any $m,$ since equation $(1)$ shows it is square when $m=5k^2+4k.$
A: You are trying to solve $J + (10m+8)^2 = n^2$ or show that no solution exists, where $J=1+(10k+4)^2$. For any $J$, you can solve $J = n^2 - p^2$ by writing it as $J = (n-p)(n+p)$ and then finding all factorizations of $J$ into two factors of equal parity (both even or both odd). This gives you all possible choices for $n$ and $p$, and then you can check whether any of the choices has $p\equiv8\pmod{10}$ (so that you can write $p=10m+8$).
This gives you an algorithm for deciding the answer for any given $k$. I don't know of any theoretical way you could determine the answer for large sets of $k$.
