# How many special right triangles are there?

We all learned in school about "special" right triangles. Special right triangles have integer side lengths. Examples include the $3$-$4$-$5$ right triangle, the $5$-$12$-$13$ right triangle, the $8$-$15$-$17$ right triangle, and their scalar multiples ($6$-$8$-$10$, $10$-$24$-$26$, $16$-$30$-$34$, etc).

How many are there? Is there a limit to the number of lowest-form (no scalar multiple) special right triangles? Are there any patterns that arise from the progression of integer side lengths?

Choose your favorite positive integers $m$ and $n$ with $m>n$. Then set $a=m^2-n^2$, $b=2mn$ and $c=m^2+n^2$. You will see then that we have the equation $a^2+b^2=c^2$.

Now, it just so happens that if you choose $m$ and $n$ so that they share no common factors, and such that $m-n$ is odd, then $a,b$, and $c$ also share no common factors. Can you see why this is true? (In fact, $a$ and $b$ won't even share any common factors themselves).

It turns out that every possible lowest-form triangle is derived from some appropriate choice of $m$ and $n$.

This answers your first question: there are infinitely many 'lowest form' triangles (called primitive triplets). It also partially answers your second question: the integer side length of one of the legs of a primitive special triangle is always the difference of two squares.

• On the other hand, there are no such solutions for exponents >=3. Apparently, some fellow by the name Andrew Wiles has discovered a truly marvelous proof of this theorem which this comment is too small to contain... – Euro Micelli Jul 25 '13 at 2:17

Such triangles can be generally constructed as follows:

$$\{n^2-1,2n,n^2+1\},n\in\mathbb{N}\land{n}\ge2$$

In other words, there is an infinite number of such triples.

This goes back to Diophantus.

Let $a,b,c$ be positive integers such that $a^2+b^2=c^2$. Then $(a,b,c)$ is a Pythagorean triple. If $p$ is a prime common divisor of $a$ and $b$, then $p$ also divides $c$: if $a=pA$ and $b=pB$, then $c^2=p^2(A^2+B^2)$, so that $p$ divides $c^2$, hence $c$. Similarly, if $a$ and $c$ have a common prime divisor, this prime divides also $b$. Thus we can assume that $a$ and $b$ are coprime, by factoring out all prime common divisors. Such a triple is primitive.

Next we can show that $a$ and $b$ are of different parity: one is odd and the other is even. They can't be both even, because they are coprime. If they were both odd, we could write $a=2A+1$ and $b=2B+1$, so $$a^2+b^2=4(A^2+A+B^2+B)+2=c^2.$$ This is impossible, because $c$ must be even, so $c=2C$ and we'd get $$2=4(A^2+A+B^2+B-C^2$$ which is clearly impossible.

Assume, without loss of generality, that $a$ is odd and $b$ is even. Then we can write $b=2B$ and $$B^2=\frac{c+a}{2}\frac{c-a}{2}.$$ Let $p$ be a prime dividing both $(c+a)/2$ and $(c-a)/2$. Then $p$ divides the sum, which is $c$, and the difference, which is $a$: absurd. Therefore $(c+a)/2$ and $(c-a)/2$ are coprime. Since their product is a square, both must be squares.

Thus $$\frac{c+a}{2}=u^2,\quad\frac{c-a}{2}=v^2$$ from which we derive $$a=u^2-v^2,\quad b=2uv,\quad c=u^2+v^2.$$ Moreover $u$ and $v$ are coprime; they can't be both odd, because otherwise $a$ would be even.

Conversely, any pair $(u,v)$ of coprime positive integers, one odd and the other even, with $u>v$, gives rise to a primitive Pythagorean triple.

For $u=2$, $v=1$ we get the triple $(3,4,5)$; for $u=3$, $v=2$ we get the next one $(5,12,13)$ and so on.