Express $k$ as the sum of three square numbers

How do you express $k$ as the sum of three square numbers, if $$m^2 + 3 = 2k$$ where both $m$ and $k$ are integers (both positive or negative if possible).

It is known that $m$ must be an odd integer, positive or negative, so that $k$ is an integer. It is also known that odd integers can be expressed as: $2n + 1$, where $n$ is an integer. Thus, how do you express $k$ as the sum of three square numbers?

• Hint: let $m=2n+1\,$, then $k = 2n^2+2n+2=n^2 + \,?^2\, + \,?^2\,$ – dxiv May 27 '17 at 1:33

Finishing dxiv's hint: $$k=\frac12(m^2+3)=\frac12((2n+1)^2+3)$$ $$=\frac12(4n^2+4n+4)=2n^2+2n+2$$ $$=n^2+(n^2+2n+1)+1=(n+1)^2+n^2+1^2$$