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

In this page there is a necessary and sufficient test given for testing Pythagorean triples:

A simpler, more powerful test is, (by naming the even leg a): $(c − a)$ and $\large\frac{(c − b)}{2}$ are both perfect squares. This is both necessary and sufficient for the triple to be a PT.

Using this here,we can write $a = 444,b=333,c=555$,which means $111$ and $\frac{222}{2}=111$ must be perfect squares but it is not.Hence,that will not work.

Is there any necessary and sufficient condition that will work for every and any (other than summing up the squares and checking for perfect squares?

NOTE: $333,444,555$ are Pythagorean triples as $3\times111,4\times111,5\times111$ for $3,4,5$ is a Pythagorean triple.

share|cite|improve this question
Read the page you linked to again. Hint: Check the definition of a primitive Pythagorean triple. – Jyrki Lahtonen Jul 14 '11 at 14:26
"This is both necessary and sufficient for the triple to be a PT[citation needed], but the PT may be derivative. If any two sides of a PT are relatively prime, it is a PPT." Wikipedia, which in this case probably is wrong (see the citation needed) says that it is true for all Pythagorean triples. – gereeter Jul 14 '11 at 14:27
I updated the question. – Max Jul 14 '11 at 14:35
up vote 1 down vote accepted

Yes, there is a mistake in the phrasing of the condition.

Every Pythagorean triple is of the form

$$ a = 2k mn \qquad b = k(m^2 - n^2) \qquad c = k(m^2 + n^2) $$

which means that

$$ c - a = k(m^2 + n^2 - 2mn) = k (m-n)^2 \qquad \frac{c-b}{2} = k n^2 $$

So the correct statement is that

Let $d$ be the greatest common divisor of $c-a$ and $(c-b)/2$. Then a necessary and sufficient condition for $(a,b,c)$ to be a Pythagorean triple is that $(c-a)/d$ and $(c-b)/(2d)$ are both perfect squares.

share|cite|improve this answer
Though honestly, I don't think this condition, which requires finding the GCD and checking whether a number is a perfect square, is any easier than the "square-and-sum" method of checking. – Willie Wong Jul 14 '11 at 14:40

The page is not correct in stating that this relation is necessary for a Pythagorean triple, as you have shown. For a non-primitive triple $c-a$ and $\frac{c-b}{2}$ can share a factor, $111$ in your case. The relation is sufficient, but it will yield some non-primitive triples, such as $27,36,45$, where $c-a=9, \frac{c-b}{2}=9$. If $c-a$ and $\frac{c-b}{2}$ do not share a factor and are not squares, it is not a PT.

share|cite|improve this answer

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.