TITLE: $x^2+y^2=z^n$: Find solutions without Pythagoras!
QUESTION [20 upvotes]: I was presented with the following problem: 

Prove that there exist solutions to $x^2+y^2=z^n$ for all $n$, with $x,y,z, n \in \mathbb{N}$

I showed that by taking any Pythagorean triple $x^2+y^2=z^2$ and multiplying by $z^{2(n-1)}$ we get $(z^{n-1}x)^2+(z^{n-1}y)^2=(z^2)^n$, which allows me to generate solutions easily for any value of $n$. I managed to find several similar questions on this site, such as this one concerning the specific case $n=3$. I notice that all of these questions take a similar approach and start with a Pythagorean triple and use it to generate general solutions.
Is there a way to prove the statement (or better yet provide solutions to the equation) without first relying on Pythagoras?

REPLY [3 votes]: I interpret your question as follows: for any positive integer $n$, there exists a positive integer $z$ such that $z^n$ is a sum of two squares (of integers). But Gauss' theorem on sums of two squares - based on the decomposition of primes in the Gaussian integers - states that a positive integer $z$ is a sum of two squares iff for any prime $p\equiv 3 \bmod 4$, the exponent $v_p(z)$ such that $p^{v_p(z)}$ divides exactly $z$ (this could be $0$) is even . Since $v_p(z^n)=nv_p(z)$, we conclude that : - if $n$ is even, any $z$ will do  -if $n$ is odd, $z$ will do iff $z$ itself is a sum of two squares .