Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For which n can $a^{2}+(a+n)^{2}=c^{2}$ be solved, where $a,b,c,n$ are positive integers? I have found solutions for $n=1,7,17,23,31,41,47,79,89$ and for multiples of $7,17,23$... Are there infinitely many prime $n$ for which it is solvable?

share|cite|improve this question
The title says "primitive", so $GCD(a,n,c)=1$ is assumed? – pharmine Oct 7 '11 at 12:35
@Angela: Very interesting question! – rubik Oct 7 '11 at 12:39
up vote 11 down vote accepted

The general primitive solution to $x^2+y^2 = z^2$ is given by: $x=u^2-v^2$, $y=2uv$, $z=u^2+v^2$, with $u,v$ relatively prime and not both odd.

For $(a,a+n,z)$ to be a primitive triple, we'd have to have a $(u,v)$ such that: $|u^2 - v^2 - 2uv| = n$. We can rewrite that as: $(u-v)^2 - 2v^2 = \pm n$

So, setting $w = u-v$, we want to find $(w,v)$ which are relatively prime and $w$ is odd, with:

$$w^2-2v^2 = \pm n$$

This means that $n$ must be odd.

In fact, we can use unique factorization in $\mathbb{Z}[\sqrt{2}]$ to show that $n$ can be any product of primes of the form $8k\pm 1$. Since there are infinitely many primes of the form $8k\pm 1$, the answer to your question is, "yes."

(Oh, and once you find one solution $(w,v)$ for a particular $n$, you can find infinitely many solutions for that $n$.)

share|cite|improve this answer
For example, $-71 = w^2 - 2v^2$ has solution $(w,v)=(1,6)$. So $u=7$, $x=u^2-v^2 = 13$, $y=2uv=84$, and $z=u^2+v^2=85$, so $n=71$ has a solution with $a=13$. – Thomas Andrews Oct 7 '11 at 19:01
Explicitly, if $p^2 + (p+n)^2 = r^2$, then subsequent ones can be found as $q^2 + (q+n)^2 = (p+q+r+n)^2$, where $q = 3p+2r+n$. – Tito Piezas III Nov 25 '14 at 23:40

$2a^{2}+2na+n^{2}=c^{2}$ --> $a=-\frac{-n+\sqrt{2c^{2}-n^{2}}}{2}$ --> there are solutions iff $x^{2}+n^{2}=2c^{2}$ has solutions --> find the set of the squares of all integers 0 in the set such that $y=2x-n$ then there is a primitive pythagorean triple with a difference of n between legs, and also for any multiple An if n>1 since if $k^{2}\equiv x(\mod{n})$ then $(Ak)^{2} \equiv Ax(\mod{An})$ --> $Ay=2Ax-An$.

share|cite|improve this answer

If you solve expression for $n$ you get

$n=\sqrt{c^2-a^2}-a$, let's denote $b=\sqrt{c^2-a^2}$,so we have that $n=b-a$

Now,take look at picture bellow.Note that $AD=a$,and $BD=b-a=n$

If you change value of $b$ and keep $a$ to be constant you will get a infinite number of right triangles,and therefore infinite number of values of $n=b-a$,so answer is yes, there are infinitely many primes $n$ for which equation is solvable.

enter image description here

share|cite|improve this answer
Except that you don't know for which integer values of $b$ yield integer values of $c$. – Thomas Andrews Oct 7 '11 at 14:57
@Thomas,That's true,I have answered only on second part of the question...however, one can find one (a,b,n) triple and then for each different triple choose another b such that n becomes prime number – pedja Oct 7 '11 at 15:18
So, what does your argument say when $n=3$? – Thomas Andrews Oct 7 '11 at 15:33
@Thomas,I didn't say that this reasoning is correct for each prime number.I just pointed that there is infinitely many distinct (a,b,n) triples such that n is prime... – pedja Oct 7 '11 at 15:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.