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?

  • 1
    $\begingroup$ N is a natural number too; I just edited the question to reflect this. $\endgroup$
    – acernine
    Commented Dec 26, 2016 at 11:45
  • $\begingroup$ Since $n \in \mathbb{N}$, infinitely many solutions may be generated when $n=1$. $\endgroup$ Commented Dec 26, 2016 at 11:49
  • $\begingroup$ the issue is not correct. I must say that if any decisions do not have such a form. $z=p^2+s^2$ $\endgroup$
    – individ
    Commented Dec 26, 2016 at 11:52
  • 2
    $\begingroup$ I suppose $x,y,z$ most not be zero, otherwise it's trivial $\endgroup$
    – user261263
    Commented Dec 26, 2016 at 12:20
  • $\begingroup$ There are infinitely many primitive solutions (that is $\gcd(x,y,z)=1$). Take two relatively prime integers $p$ and $q$ such that $p-q$ is odd. Choose $x$ and $y$ such that $$x+yi=(p+qi)^n.$$ Then, $$x^2+y^2=z^n,$$ where $$z=p^2+q^2.$$ By the choices of $p$ and $q$, $\gcd(x,y,z)=1$. $\endgroup$ Commented Oct 20, 2019 at 10:55

2 Answers 2


The solution $(x,y,z)=(0,1,1)$ works for all $n$.

If you don't want to allow $0$, then let $x,y\in\Bbb{N}$ be such that $$x+yi=(1+2i)^n.$$ Then $$5^n=((1+2i)(1-2i))^n=(1+2i)^n(1-2i)^n=(x+yi)(x-yi)=x^2+y^2.$$

Alternatively, if $n$ is odd let $m:=\frac{n-1}{2}$ so that $$(2^m)^2+(2^m)^2=2^n.$$

Finally, less constructively, a theorem of Gauss tells us that if an integer is not divisible by any prime congruent to $3$ modulo $4$, then it is a sum of two squares. Hence solutions exist for any $n$.

  • 5
    $\begingroup$ Question says x,y,z belong to N. 0 does not belong to N. $\endgroup$ Commented Dec 26, 2016 at 12:26
  • 5
    $\begingroup$ I've rarely encountered an instance of $\Bbb{N}$ not containing $0$ outside this forum, but as it does make the question somewhat less trivial I'll updat my answer. $\endgroup$
    – Servaes
    Commented Dec 26, 2016 at 12:29
  • 2
    $\begingroup$ The standard ISO 80000-2 (International Organisation for Standardization) includes $0 \in \mathbb{N}$. However, other definitions suggest that $1$ is the smallest element of $\mathbb{N}$ $\endgroup$ Commented Dec 26, 2016 at 12:33
  • 5
    $\begingroup$ In that case, I suggest you use $\mathbb{Z}^+$ instead. It is significantly less ambiguous. $\endgroup$ Commented Dec 27, 2016 at 1:39
  • 2
    $\begingroup$ For me, $0\in\mathbb{N}$. $\endgroup$
    – user5402
    Commented Dec 29, 2016 at 14:13

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 .


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .