Number which is simultaneously sum of 2 and 3 squares Is there positive integer $m$ such $m=x_1^2+x_2^2$ and $m=y_1^2+y_2^2+y_3^2$ where $x_i, y_j$ are nonzero integers. I have tried by hand for the ten natural numbers but I was not able to find such $m$.
Would be thankful for help.
 A: Obviously, if there are any solutions to $a^2 =b^2 + c^2$, then you can add $x^2$ to both sides and get your $m$'s.
For example, $25 + x^2 = 9 + 16 + x^2$ for all natural numbers $x$.
You can even have $m$ be a perfect square AND a sum of two squares AND a sum of three squares (take $x=12$ above).
A: There is a possibly famous identity:
$$\Large 10^2+11^2+12^2=13^2+14^2$$ which meets your criteria.
Here $m$ is $365$.
A: Alternatively you could use a formula to generate examples; for example
$$m=\left(a^2+b^2+c^2\right)^2+\left(a^2-c^2\right)^2=\left(a^2+c^2\right)^2+\left(2cb\right)^2+\left(a^2+b^2-c^2\right)^2$$
originating from the identity
$$\left(a^2+b^2+c^2\right)^2-\left(a^2+b^2-c^2\right)^2=\left(2ca\right)^2+\left(2cb\right)^2$$
and using $$\left(a^2+c^2\right)^2-\left(a^2-c^2\right)^2=\left(2ca\right)^2$$
to substitute for $\left(2ca\right)^2$
A: Here's a theoretical answer:  any prime $p$ of the form $8k+1$ will work (this gives infinitely many examples, including the example of 17 in Dietrich's example).
Why is this true?  
First, Fermat proved that any prime $p$ of the form $8k+1$ (in fact 1 mod 4) is of the form $x^2+y^2$.  Being prime, it's not a square so both $x, y$ must be nonzero for $x^2+y^2=p$.
Second, Fermat also proved that any prime $p$ of the form $8k+1$ (in fact 1 or 3 mod 8) is of the form $x^2+2y^2$.  Again, no prime can be of the form $x^2$ or $2y^2$, so we need both $x,y$ nonzero for $x^2+2y^2=p$.  Then $p=x^2+y^2+z^2$ with $z=y$ and $x,y,z$ all nonzero.
A: Combine the sequences A001481 and A000378. The positive integers appearing in both sequences are sum of two squares, and a sum of three squares, e.g., $$17=16+1=4+4+9$$
