The calculators on this page require JavaScript but you appear to have switched JavaScript off (it is disabled). Please go to the Preferences for this browser and enable it if you want to use the calculators, then Reload this page.

Pythagorean Right-Angled Triangles

Right-angled triangles with whole number sides have fascinated mathematicians and number enthusiasts since well before 300 BC when Pythagoras wrote about his famous "theorem". The oldest mathematical document in the world, a little slab of clay that would fit in your hand, can be seen a list of such triangles. So what is so fascinating about them? This page starts from scratch and has lots of facts and figures with several online calculators to help with your own investigations.
Contents of this page
The Things To Do icon means there is a Things to do section of questions to start your own investigations. The calculator calculator icon indicates that there is a live interactive calculator in that section.

Right-angled Triangles and Pythagoras' Theorem

Pythagoras and Pythagoras' Theorem

Pythagoras was a mathematician born in Greece in about 570 BC. He was interested in mathematics, science and philosophy. He is known to most people because of the Pythagoras Theorem that is about a property of all triangles with a right-angle (an angle of 90°): legs a,b; hyp=h If a triangle has one angle which is a right-angle (i.e. 90°) then there is a special relationship between the lengths of its three sides:
If the longest side (called the hypotenuse) is h and the other two sides (next to the right angle) are called a and b, then:
a2 + b2 = h2     Pythagoras' Theorem
or,
the square of the longest side is the same as the sum of the squares of the other two sides.
h2 = a2 + b2 is only true for right-angled triangles.
Note that in any triangle, the longest side h cannot be longer than the sum of the other two sides. so h < a + b.
If it equalled the sum of the other two then the triangle is just a line of length a + b = h!

For example, if the two shorter sides of a right-angled triangle are 2 cm and 3 cm, what is the length of the longest side?
If the longest side is h, then, by Pythagoras' Theorem, we have:
h2=22 + 32 = 13
h=√13 = 3·60555

On this page, a triangle with a right-angle (so that Pythagoras' theorem applies)
and whose sides have lengths which are whole numbers
is called a Pythagorean triangle

Some visual proofs of Pythagoras' Theorem

4xtriangle + a^2+b^2 = 4 x triangle + c^2 animated proof My favourite proof of the look-and-see variety is on the right.


Both diagrams are of the same size square of side a + b.
Both squares contain the same four identical right-angled triangles in white (so it is white-angled :-)) with sides a, b, c. The left square also has two blue squares with areas a2 and b2 whereas the right hand one replaces them with one red square of area c2.
This does not depend on the lengths a, b, c; only that they are the sides of a right-angled triangle.
So the two blue squares are equal in area to the red square, for any right-angled triangle: a2 + b2 = c2
This makes an effective visual aid by pushing the squares from their locations on the left to where they are shown on the right. Don't turn them or flip them, just move them to their respective corners.
device to illustrate Pythagoras theorem

There is a very nice illustration of A Device That Illustrates Pythagoras' Theorem that is a Mathematica Demonstration. Click on the image on the right here to see an animation in a new window or to download the active controls version usable with the free Mathematica player.
Bill Richardson has a nice animation of Bhaskara's proof

The 3-4-5 Triangle

In the example above, we chose two whole-number sides and found the longest side, which was not a whole number.

It is perhaps surprising that there are some right-angled triangles where all three sides are whole numbers called Pythagorean Triangles. The three whole number side-lengths are called a Pythagorean triple or triad.
3-4-5 triangle An example is a = 3, b = 4 and h = 5, called "the 3-4-5 triangle". We can check it as follows:
32+42 = 9 + 16 = 25 = 52 so a2 + b2 = h2.

This triple was known to the Babylonians (who lived in the area of present-day Iraq and Iran) even as long as 5000 years ago! Perhaps they used it to make a right-angled triangle so they could make true right-angles when constructing buildings - we do not know for certain.

It is very easy to use this to get a right-angle using equally-spaced knots in a piece of rope, with the help of two friends. If you hold the ends of the rope together together and one friend holds the fourth knot and and the other the seventh knot and you all then tug to stretch the rope into a triangle, you will have the 3-4-5 triangle that has a true right-angle in it.
The rope can be as long as you like so you could lay out an accurate right-angle of any size.

The sum of the sides of a triangle is called its perimeter.
We can also easily draw a 3 4 5 triangle as follows:
  1. The is a 3 4 5 triangle

3 4 5 on graph paper But all Pythagorean triangles are even easier to draw on squared paper because all their sides are whole number lengths.
Measure the lengths of the two smaller sides (those around the right-angle) as lengths along and up from the same point and then join the two end-points together.
So Pythagorean triangles also tell us which pairs of points with whole-number coordinates are a whole-number distance apart not in a horizontal or vertical direction.

Test a Triangle - is it Pythagorean?

legs a,b and hyp h Here is a little calculator that, given any two sides of a right-angled triangle will compute the third, or you can give it all three sides to check. It will check that it is right-angled and, if so, if it is Pythagorean (all the sides are integers).
Here a and b are the two legs, the sides surrounding the right-angle, and h is the longest side, the hypotenuse:

PT?: Is it Pythagorean? Calculator

 C A L C U L A T O R
a: b: h:

R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

More Pythagorean Triples

Is the 3-4-5 the only Pythagorean Triple?
No, because we can double the length of the sides of the 3-4-5 triangle and still have a right-angled triangle:
its sides will be 6-8-10 and we can check that 102 = 62 + 82.

Continuing this process by tripling 3-4-5 and quadrupling and so on we have an infinite number of Pythagorean triples:

345
6810
121620
152025
182430
...
or we can take the series of multiples 1, 11, 111, 1111, etc. and get a pattern:
345
334455
333444555
333344445555
...
All of these will have the same shape (have the same angles) but differ in size - the mathematical term is that they are all similar triangles. If they were the same size but in different positions or orientations, the triangles are called congruent.

Are there any other differently-shaped right-angled triangles with whole number sides?
Yes; one is 5, 12, 13 and another is 7, 24, 25.
We can check that they have right angles by using Pythagoras's Theorem that the squares of the two smaller sides sum to the square of the longest side. For example
52 + 122 = 25 + 144 = 169 = 132
72 + 242 = 49 + 576 = 625 = 252

Graphs of the numbers of Pythagorean Triangles

The number of Pythagorean Triangles with a hypotenuse up to a given limit is remarkable consistent as the limit increases as is shown by these graphs:

Graphs of the number of Pythagorean Triangles
with Hypotenuse<H:
HOnly
Primitives
AllPrimitives+All
100
300
1000
5000
Number of PTs graph
H
Later we will look more closely at these graphs and find a surprising number appears in connection with these straight lines.

But for now, how do we find these Pythagorean triangles? Is there a systematic method?

Methods of Generating Pythagorean Triangles

The simplest method of finding all Pythagorean triples

Richard du Croo de Jongh wrote to me in July 2019 pointing out that what is surely the simplest method of generating all Pythagorean triangles!
The method is mentioned in Kraitchik's Mathematical Recreations on page 97: see the reference below.
If a2 + b2 = h2 then
a2 = h2 - b2 which factorises:
a2 = (h + b)(h - b)
So find two factors of a2, say P and Q and P>Q. Then
P = h + b, Q = h - b which means that
h = (P + Q)/2, b = (P - Q)/2.
In order that P and Q are whole numbers, P and Q must be both odd or both even and P > Q (or else b is 0 or negative).
Let's try an example with a = 12:
a2 = 144. Possible P and Q are:
P=144,Q=1 but one is even and one odd (giving a fractional value for b and h)
P=72, Q=2 and both are even
(P+Q)/2 = h = 37; (P-Q)/2 = b = 35: the triple is a=12, b=35, h=37
P=48, Q=3 but one is even and one odd (giving a fractional value for b and h)
P=36, Q=4 and both are even
(P+Q)/2 = h = 20; (P-Q)/2 = b = 16: the triple is a=12, b=16, h=20
P=24, Q=6 and both are even
(P+Q)/2 = h = 15; (P-Q)/2 = b = 9: the triple is a=12, b=9, h=15
P=18, Q=8 and both are even
(P+Q)/2 = h = 13; (P-Q)/2 = b = 5: the triple is a=12, b=5, h=13
P=16, Q=9 but one is even and one odd (giving a fractional value for b and h)
So there are just 4 Pythagorean triangles with a side of 12.
A similar method involving factors is the Hypotenuse-Leg difference method see below.

A simple two-unit-fraction method of generating PTs

This is a very simple method of generating Pythagorean triangles. It is based on forming the sum of two unit fractions for either consecutive odd numbers or consecutive even numbers.
odd 
A
next
B=A+2
1/A+1/BHyp
134/35
358/1517
5712/3537
7916/6365
...

Two consecutive odd unit fractions

Take two odd numbers that differ by two, such as 3 and 5.
Make them into unit fractions: 1/3 and 1/5
and add them: 1/3 + 1/5 = 8/15
The two numbers in the sum are always two sides of a primitive Pythagorean triangle!
Here the Pythagorean triangle is 8, 15, 17.
even
A
next
B=A+2
1/A+1/BHyp
243/45
465/1213
687/2425
8109/4041
...

Two consecutive even unit fractions

Take two even numbers that differ by two, such as 2 and 4.
Make them into unit fractions: 1/2 and 1/4
and add them: 1/2 + 1/4 = 3/4
The two numbers in the reduced sum are always two sides of a primitive Pythagorean triangle!
Here it is the 3, 4, 5 triangle.

However, neither using the two odds nor the two evens generate all the primitive Pythagorean triangles, but there is a method using two fractions that does.

The Two-Fractions method of generating Pythagorean Triples

Here is a very simple way of generating as many Pythagorean triangle as you want:
Method:    Example 1:   Example 2:
Take any two fractions (or whole numbers) whose product is 2
Notice that the fractions do not have
to be in their lowest form
:
1/3 6 4/22/2
Add 2 to each fraction: 7/3 88/2 6/2
Cross multiply to turn both into whole numbers 7 241612
These are two sides of a Pythagorean triangle: 7 241612
To find the third, add the squares of these two numbers:    72+242
= 49 + 576
= 625
   162+122
= 256 + 144
= 400
... and take the square-root to find the hypotenuse: √625 = 25 √400 = 20
to get the Pythagorean triangle: 7 24 25 16 12 20

This works for any two fractions whose product is 2 and always generates a Pythagorean triangle:

Start withto get:
1 2 3 4 5
2/2
1
2
4/2
6 8 10
1/2
2/4
8/2
4
5 12 13
3/3
1
2
6/3
9 12 15
2/3 3 8 15 17
4/4
2/2
1
2
4/2
8/4
12 16 20
1/3 6 7 24 25
3/2 4/3 20 21 29
1/4 8 9 40 41
In fact, all primitive Pythagorean triples are generated from two fractions in lowest form and all non-primitive Pythagorean triples are generated when at least one of the fractions is not in its lowest form. (See later on this page).

Here is a calculator for your experiments and some questions to investigate below it.

Generate PTs using Two Fractions Calculator

C A L C U L A T O R
Give two fractions whose product is 2 :
they do not have to be in lowest form
and 
with fractions ka/kb, 2b/a with k= and  
a= up to
b= up to
Factorize non-primitive triples:   Use 2b/a in its lowest form:
to generate the Pythagorean triple
optional

R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

/ You Do The Maths...

  1. Find starting fractions that generate the multiples of 3 4 5: 6 8 10, 9 12 15, 12 16,20, ...
    Are some multiples impossible to generate by this method?
  2. Which multiples of 5 12 13 can you generate from two fractions? 10 24 26, 15 36 39, 20 48 52, ...?
  3. Use algebra to prove the two-fractions method always produces a Pythagorean triangle from any two initial numbers, as follows, starting with
    a and c2 b
    ba
    where a, b and c are whole numbers. Hint: expand ( a2 + 2ab + 2 b2 )2
    a/b + 2 = (a+2b)/b
    (2b)/a + 2 = 2(a+b)/a cross-multiplying:
    (a+2b) a, 2(a+b) b; squaring each and adding gives:
    (a2 + 2ab + 2 b2)2
  4. Find a triple that needs two fractions (not a fraction and a whole number) to generate it.
    3/2 and 4/3 give 20 21 29
  5. How many pairs of numbers generate 6 8 10?
    4 1
    2

    2 2
    2
I do not have a reference for this method, so if anyone can help, please do email me (details on the link that is my name the foot of this page). Thanks!

But rather than a method ....

... is there is a formula for generating Pythagorean triples?

The m,n formula for generating Pythagorean Triples

 2mn       m2 + n2
m2 – n2
Yes - we can generate Pythagorean Triples by supplying two different positive integer values for m and n in this diagram. You can multiply out these terms and check that
( m2 – n2 )2 + (2 m n)2 = ( m2 + n2 )2
Once we have found one triple, we have seen that we can generate many others by just scaling up all the sides by the same factor.
A Pythagorean triple which is not a multiple of another is called a primitive Pythagorean triple.

So 3,4,5 and 5,12,13 are primitive Pythagorean triples
but 6,8,10 and 333,444,555 and 50,120,130 are not.

Are all the Pythagorean triples generated by m,n?

The bad news is that the answer is "No", but the good news is that all primitive Pythagorean triples are generated by some m,n values in the formula above!
The formula using m,n will not give all triples since it misses some of the non-primitive ones, such as 9,12,15. This is a Pythagorean triple since, as a triangle, is it just three times the 3,4,5 triangle (by which we mean that we just MULTIPLY the lengths of each side of a 3,4,5 triangle by 3, which we already know is right-angled).

But 9, 12, 15 is missed by our m,n formula because:

Our formula said m and n were positive whole numbers and the Pythagorean triple was
m2 – n2 , 2mn , m2 + n2
and, since we want (positive) whole number values in our triple, then m > n (otherwise the first number in the triple is negative).
The 2mn value is one of the sides and the only even side in 9, 12, 15 is 12, so 12 = 2 m n.
Hence m n = 6. But m > n, so we can only have two cases:
  1. m = 6 with n = 1 OR
  2. m = 3 and n = 2
The first case gives the triple 35, 12, 37 and the second case gives 5, 12, 13, neither of which is the 9, 12, 15 triple.
There are two values which generate 9, 12, 15 and they are m = 2√2, n=√2.

In fact there are always m,n values for all PTs but they are not always integers:
If m,n generates a, b, h then g×a, g×b, g×h is generated by g m, √g n.

m2 – n2 , 2mn , m2 + n2
All the primitive Pythagorean triangles are each generated once if and only if) one of m,n pair is odd and the other is even.
This is often described as m and n have opposite parity.
Since all the sides of the triangle are positive then we also need m>n.

For more on this and a proof, see the Hardy and Wright book "Introduction to the Theory of numbers" in the References at the foot of this page.

Here is a table of Pythagorean triangles with a smaller side up to 40:

Tripleprimitive?m,n
3, 4, 5primitive2,1
5, 12, 13primitive3,2
6, 8, 10 3, 4, 53,1
7, 24, 25primitive4,3
8, 15, 17primitive4,1
9, 12, 15 3, 4, 5
9, 40, 41primitive5,4
10, 24, 26 5, 12, 135,1
11, 60, 61primitive6,5
12, 16, 20 3, 4, 54,2
12, 35, 37primitive6,1
13, 84, 85primitive7,6
14, 48, 50 7, 24, 257,1
15, 20, 25 3, 4, 5
15, 36, 39 5, 12, 13
15, 112, 113primitive8,7
16, 30, 34 8, 15, 175,3
16, 63, 65primitive8,1
17, 144, 145primitive9,8
18, 24, 30 3, 4, 5
18, 80, 82 9, 40, 419,1
19, 180, 181primitive10,9
20, 48, 52 5, 12, 136,4
20, 99, 101primitive10,1
20, 21, 29primitive5,2
Tripleprimitive?m,n
21, 28, 35 3, 4, 5
21, 72, 75 7, 24, 25
21, 220, 221primitive 11,10
22, 120, 122 11, 60, 6111,1
23, 264, 265primitive 12,11
24, 32, 40 3, 4, 56,2
24, 45, 51 8, 15, 17
24, 70, 74 12, 35, 377,5
24, 143, 145primitive12,1
25, 60, 65 5, 12, 13
25, 312, 313primitive 13,12
26, 168, 170 13, 84, 8513,1
27, 36, 45 3, 4, 56,3
27, 120, 123 9, 40, 41
27, 364, 365primitive 14,13
28, 96, 100 7, 24, 258,6
28, 45, 53primitive7,2
28, 195, 197primitive14,1
29, 420, 421primitive 15,14
30, 40, 5010× 3, 4, 5
30, 72, 78 5, 12, 13
30, 224, 226 15, 112, 11315,1
31, 480, 481primitive 16,15
32, 60, 68 8, 15, 178,2
32, 126, 130 16, 63, 659,7
32, 255, 257primitive16,1
Tripleprimitive?m,n
33, 44, 5511× 3, 4, 5
33, 180, 183 11, 60, 61
33, 544, 545primitive 17,16
33, 56, 65primitive7,4
34, 288, 290 17, 144, 14517,1
35, 84, 91 5, 12, 13
35, 120, 125 7, 24, 25
35, 612, 613primitive 18,17
36, 48, 6012× 3, 4, 5
36, 160, 164 9, 40, 4110,8
36, 105, 111 12, 35, 37
36, 323, 325primitive18,1
36, 77, 85primitive9,2
37, 684, 685primitive 19,18
38, 360, 362 19, 180, 18119,1
39, 52, 6513× 3, 4, 5
39, 252, 255 13, 84, 85
39, 760, 761primitive 20,19
39, 80, 89primitive8,5
40, 96, 104 5, 12, 1310,2
40, 75, 85 8, 15, 17
40, 198, 202 20, 99, 10111,9
40, 399, 401primitive20,1
40, 42, 58 20, 21, 297,3

Generate PTs using the m,n formula Calculator

 2mn       m2 + n2
m2 – n2
Here is a calculator to compute the sides of a triangle using the formula above - just type in the values for m and n. Remember that the formula will find all the Primitive Triples but it will not find all the non-primitives. The calculator will tell you if your values of m and n generate a Primitive triple or a multiple of a primitive.
Alternatively, you can give it a single m value or a range of m values and it will show you all the triangles it can generate.
Finally, give it a Pythagorean triangle and it will test if it has generators m and n or not.

m,n C A L C U L A T O R
with m= n=
triangles with m= up to m=
for a: b: h:
R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

The two-fraction method and the m,n generators method

We can now show that the two-fractions method that we saw earlier on the page generates all primitive Pythagorean triples by identifying n with b and m with a + b to find two starting fractions.
This is equivalent to choosing a = m – n and b = n for fractions
a and 2b
ba
to get the primitive triple with m,n generators.
If the triangle is non-primitive, say it is k times a primitive triangle, then the substitutions above give the primitive triangle and we need only multiply one of the fractions by k on the top and on the bottom to get the non-primitive one.

The Fibonacci method

The Fibonacci numbers are generated by starting from 1 and 2 and then using the method add the latest two to get the next. We use this method here to generate PTs.
Take any 2 numbers to start your Fibonacci series, such as 1 and 3. In a Fibonacci-like way, add them to produce the next: 1, 3, 4 and extend your series once more by the same rule: 1, 3, 4, 7. Now you can make a Pythagorean Triple as follows:
Using the Fibonacci-type series of 4 numbers: 1, 3, 4, 7:
First leg:
Multiply the middle two numbers and double the result:
here 3 times 4 is 12 which we double to get
24 : the first side of our Pythagorean Triangle
Second leg:
Multiply the two outer numbers:
here 1 times 7 gives
7 : the second side of the Pythagorean triangle
Hypotenuse:
  1. EITHER add the squares of the middle two numbers:
    here 32 + 42 = 25
  2. OR from the product of the last two subtract the product of the first two:
    here 4×7 – 1×3 = 25
Both give
25 : the hypotenuse of the Pythagorean triangle
So we have found the primitive Pythagorean triangle 7, 24, 25.

You can start with any two numbers and use the Fibonacci Rule: add the latest two to get the next to generate two more. The four numbers will always generate a Pythagorean Triangle. Try it for yourself or using the Calculator below!

PTs from a Fibonacci sequence Calculator

C A L C U L A T O R
Fibonacci starting values

R E S U L T S


 

calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

The Fibonacci method and the m,n formula method

The explanation of why the Fibonacci method works is simple and is related to the m,n formula method above:
The two middle values are the m and n values for the m,n formula for generating Pythagorean Triples that we looked at earlier on this page:
m – n, n, m, m + n
Using the method above for this Fibonacci-type series of 4 numbers, the sides of the Pythagorean triangle are :
  1. twice the product of the middle two: 2 m n
  2. the product of the outer two values: (m – n) (m + n) = m2 – n2
  3. the sum of squares of the inner two values: m2 + n2
We saw earlier that not all Pythagorean triples can be generated by the m-n method.
We have just shown that the Fibonaccimethod is equivalent to that method and so the Four-term Fibonacci method will also fail to produce all triples.
It can produce all primitive triples but not all of the composite ones.
Let's call our four number in a Fibonacci-type progression a, b, c, d so that a + b = c, b + c = d.
Then we have: so that, in many ways, the lengths of significant constructs in a Pythagorean triangle are more easily and more naturally described using the four Fibonacci sequence values a b c d than the with the m,n generators.

Hypotenuse-Leg difference

Hassan Ouramdane emailed me (3 November 2014) with this alternative method of generating PTs in terms of the difference between the hypotenuse and one side.
For PT a, b, h suppose the difference between one side, b say, and the hypotenuse h is d then we have b + d = h.
Using Pythagoras' Theorem we have:
a2 + b2 = h2 and we can replace h by b + d
a2 + b2 = (b + d)2 Now expand the brackets:
a2 + b2 = b2 + 2 b d + d2 and we see that we can subtract b2 from both sides:
a2        =        2 b d + d2 and the right-hand side will now factorize
a2 = d (2 b + d)
This tells us that
the difference between the leg b and the hypotenuse h must be
a factor of the square of the other leg a
which gives us an easy way of generating such triangles, given one side of a PT a and a difference d:
  1. find all the factors of a2 that are less than a
    because the other factor is (2 b + d) which is bigger than d
  2. All of these factors can be a value for d.
To find the PTs, one of the sides being a do the following for each value of d.
Since a2 = d (2 b + d)
then
a2 – d = 2 b
d
:
  1. Divide the given side squared (a2) by d
  2. From the result subtract d
  3. IF the result is even, divide it by 2 to find the second leg b
    For some factors we will not get an even number and therefore such factors cannot be values for d.
  4. If the value was a whole number, then add d to it to find the hypotenuse h in the PT a, b, b+d
For instance, find PTs with one side 12:
122 = 144 = 24 32
The factors of 144 that are less than 12 are:
1, 2, 3, 4, 6, 8 and 9 which are possible values for the difference h - b = d:
Taking each in turn:
1?
144/1 - 1 = 143 which we cannot divide by 2
2?
144/2 - 2 = 72 - 2 = 70 which is even so b = 35:
12, 35, 37=35+2
3?
144/3 - 3 = 48 - 3 = 45 which is not even.
4?
144/4 - 4 = 36 - 4 = 32 which is even so b = 16:
12, 16, 20=16+4
6?
144/6 - 6 = 24 - 6 = 18 which is even so b = 9:
12, 9, 15=9+6
8?
144/8 - 8 = 18 - 8 = 10 which is even so b = 5:
12, 5, 13=5+8
9?
144/9 - 9 = 16 - 9 = 7 which is not divisible by 2

An easy method of writing down a series of Triples

Look at the following series of Pythagorean triples. It is easy to spot the pattern and to remember it. If you then write it down to show your friends it will look as if you have impressive calculating skills!
21220221
2012020020201
200120020002002001
20001200020000200020001
It uses n+1 for m in the formula and then lets n be powers of 10. This simplifies the triples to be 2n+1, 2n(n+1), 2n2+2n+1.

There is a Calculator below that you can use to generate many more simple patterns like this one.
Can you find another simple method like those above that always produces Pythagorean Triangles?

Patterns in Pythagorean Triples

Let's call the two sides of the triangle that form the right-angle, its legs and use the letters a and b. The hypotenuse is the longest side opposite the right-angle and we will often use h for it.
The two legs and the hypotenuse are the three sides of the triangle, triple or triad a ,b, h.

Different authors use different ways of writing triads such as a-b-h but we will use a, b, h on this page.

The series of lengths of the hypotenuse of primitive Pythagorean triangles begins 5, 13, 17, 25, 29, 37, 41 and is A020882 in Sloane's Online Encyclopedia of Integer Sequences. It will contain 65 twice - the smallest number that can be the hypotenuse of more than one primitive Pythagorean triangle. The series of numbers that are the hypotenuse of more than one primitive Pythagorean triangle is 65, 85, 145, 185, 205, 221, 265, 305,... A024409

There are lots of patterns in the list of Pythagorean Triples above. To start off your investigations here are a few.

Hypotenuse and Longest side are consecutive

3,4,5
5,12,13
7,24,25
9,40,41
11,60,61
The first and simplest Pythagorean triangle is the 3, 4, 5 triangle. Also near the top of the list is 5, 12, 13. In both of these the longest side and the hypotenuse are consecutive integers.
The list here shows there are more.
Can you spot the pattern?
Chris Evans when a student of Diss High School found the following pattern:
11
3
= 4
3
3 4 (5)
22
5
=12
5
5 12 (13)
33
7
=24
7
7 24 (25)
44
9
=40
9
9 40 (41)
...
where the fractions give the two sides and the hypotenuse is the numerator + 1

Can we find a formula for these triples?
You will have noticed that the smallest sides are the odd numbers 3, 5, 7, 9,... So the smallest sides are of the form 2i+1.
The other sides, as a series are 4, 12, 24, 40, 60... Can we find a formula here?
We notice they are all multiples of 4: 4×1, 4×3, 4×6, 4×10, 4×15,.. . The series of multiples: 1, 3, 6, 10, 15,... are the Triangle Numbers with a formula i(i+1)/2.
So our second sides are 4 times each of these, or, simply, just 2i(i+1).
The third side is just one more than the second side: 2i(i+1)+1, so our formula is as follows:
shortest side = 2i+1; longest side = 2i(i+1); hypotenuse = 1+2i(i+1)
Check now that the sum of the squares of the two sides is the same as the square of the hypotenuse (Pythagoras's Theorem).
ia:2i+1b:2i(i+1)h=b+1
132×1×2=45
252×2×3=1213
372×3×4=2425
492×4×5=4041
5112×5×6=6061
6132×6×7=8485
7152×7×8=112113
Bill Batchelor points out that the sum of the two consecutive sides is 4 i2 + 4 i + 1 which is just the square of the smallest side.
This gives us an alternative method of generating these triples:

Alternatively, let's look at the m,n values for each of these triples. Since the hypotenuse is one more than a leg, the 3 sides have no common factor so are primitive and therefore all of them do have m,n values:

Triplemn
3, 4, 521
5, 12, 1332
7, 24, 2543
9, 40, 4154
11, 60, 6165
It is easy to see that m = n + 1.
The m,n formula in this case gives
a = m2n2 = (n+1)2n2 = 2 n + 1
b = 2 m n = 2 (n+1) n = 2 n2 + 2 n
h = m2 + n2 = (n+1)2 + n2 = 2 n2 + 2 n + 1
So h is b+1 and the pattern is always true:
if m = n+1 in the m,n formula then it generates a (primitive) triple with hypotenuse = 1 + the longest leg.
Are these all there are? Perhaps there are other m,n values with a leg and hypotenuse consecutive numbers. In fact, they are all given by the formula above because:
The triangles must be primitive so we know they have an m,n form.
h = m2 + n2 could be either one more than either m2n2 or 2 m n: The only condition we can have is that m – n = 1, that is m = n + 1. There are no other triangles with hypotenuse one more than a leg except those generated by consecutive n+1, n as values in the m,n formula.

More information on these series:

The series 4, 12, 24, 40, 60,... of longest legs [ numbers given by the formula 2 n(n+1) ]
and 5, 13, 25, 41, 61, ... [ numbers of the form 2 n(n+1) + 1 ] are also connected by this unusual pattern of square number sums:
32 + 42 = 52
102 + 112 + 122 = 132 + 142
212 + 222 + 232 + 242 = 252 + 262 + 272
362 + 372 + 382 + 392 + 402 = 412 + 422 + 432 + 442
...

The two legs are consecutive

Also in the 3, 4, 5 triple, the two legs of the triangle a and b are consecutive, b = a+1. Are there any more like this?
Yes! 20, 21, 29.
Although the list above does not contain any more, there are larger examples:
3, 4, 5     20, 21, 29     119, 120, 169     696, 697, 985
Because the two legs are consecutive numbers, they will have no common factor so all of these will be primitive. We can therefore find certain special values for m and n in the m,n formula above. Here is the same list with their m,n values:
mna=m2-n2 b=a+1=2mn h=m2+n2
21345
52212029
125119120169
2912697696985
This already suggests a way that we can use the generators m and n for one triple to find generators for the next.
See if you can find how and also find a formula for this pattern of triples.

Kayne Johnston aged 13 has also found the neat pattern to compute this table without using the m and n generators, each row being computed simply from the two rows before:
the next row in the table has a smallest side that is


For instance, after the first two rows, where the smallest sides are 3 and 20, the next is 6 203 + 2 = 120 –3 + 2 = 119.
The other side is just one more than the smallest, so here is it 120.
If the smallest side of the nth triple is s(n) then a formula for s(n) is:
s(1) = 3
s(2) = 20
s(n) = 6 s(n–1) – s(n–2) + 2, if n>2

Can you find a similar method to compute the hypotenuse but without using Pythagoras Theorem on the two sides?

The series here are:

The recursion formulae are often written more precisely in terms of the index number (n) of the term, so if we call the series a, the general term is a(n) or an and therefore the previous term in the series is a(n-1) or an-1.
The formula next term is 6×last term – penultimate term + 2 can be written an = 6 an-1 – an-2 + 2.
We also have: Beiler (see reference at the foot of this page) gives a formula for these triples so that the rth triple in this list is given directly in terms of r.

Dan Sikorski points out that the ratio of successive hypotenuses tends to 3 + 2 √2.
This is also borne out by the continued fraction for this value, which is [5; 1,4] = 5.82842712474619 and its convergents are
5,  6,  29,  35,  169,  204,  985,  ...
11562935169

The m,n values for consecutive-legs triangles

mna=m2-n2 b=a+1=2mn h=m2+n2
21345
52212029
125119120169
2912697696985
In the previous section we found a recursion pattern in the series of smallest sides in the consecutive leg triangles. Now let's look again at these triangles but concentrate on their m,n values as shown in the table here:
The m,n values are successive terms of a single series: 1, 2, 5, 12, 29, ....
Can you guess the next number in this series?
It is a similar kind of series to the smallest sides, where only the previous two numbers are needed to compute the next. This time the rule is
2 times the previous one plus the one before that
For example, after 1, 2 the next would be 2 + 1 = 5.
and after 1, 2, 5 the next would be 5 + 2 = 12, and so on. Extending the series beyond 29 we have 1, 2, 5, 12, 29, 70, 169, 408, 985, ... .

This series of numbers is called the Pell numbers (A000129).
Any pair of neighbouring numbers used as m,nvalues generates all of the Pythagorean triangles with consecutive sides and only those triangles.

/ You Do The Maths...

  1. With the Fibonacci numbers, the ratio of one Fibonacci number to the previous one gets closer and closer to Phi. What value does this ratio approach for the Pell Numbers: 1, 2, 5, 12, 29, ...?
    √2 + 1
  2. If you have looked at the page on An Introduction to Continued Fractions then use The CF Calculator in a new window to answer this question:
    How are the Pell numbers related to the convergents to √2 = 1.414213562373095..?
    They are the denominators of the convergents:
    1/1 = 1
    3/2 = 1.5
    7/5 = 1.4
    17/12 = 1.4166666666666667
    41/29 = 1.4137931034482758
    99/70 = 1.4142857142857144
    239/169 = 1.4142011834319526
    ...
    See A000129

Another Side Difference - the excess

We can also classify PTs by the difference in their two legs: b - a;
or the difference between one leg and the hypotnuse: h - a and h - b.
There is a further difference that has some nice properties: the excess.

In every triangle we must have every pair of sides having a total which is bigger than the third side.
If not, the pair of sides will not meet to make a triangle because the third side is too big.
In our Pythagorean triangles, the two legs must together excess the hypotenuse and the difference is called the excess = h - (a + b).

The excess tells us how much further we have to walk if we went from A to B following the two sides of the right-angled triangle (a+b) as opposed to the direct route along the hypotenuse A to B (h).
excess = a + b − h
We can illustrate the excess a+b−h geometrically also:
  1. Measure off side b along h (from point A) Show me
  2. Take the remainder of h: (h-b), away from side a Show me
  3. What is left of side a is the excess:a-(h-b)=a+b-h=OP Show me
We can do the same starting with side a:
  1. Measure off side a along h (from point B) Show me
  2. Take the remainder of h: (h-a), away from side b Show me
  3. What is left of side a is the excess:b-(h-a)=a+b-h=OQ Show me
  4. This excess is the diameter of the inCircle Show me
Start again
The excess is the diameter of the incircle - the largest circle that fits inside the triangle touching the three sides.
This is because
the diameter parallel to OB in the diagram meets line OA at a distance h-a + (a+b-h)/2 = (h+b-a)/2 from A
the diameter parallel to OA in the diagram meets line OB at a distance h-b + (a+b-h)/2 = (h-b+a)/2 from B
Since these two distances sum to h, then they define a unique point on AB which is (h+b-a)/2 from A and (h-b+a)/2 from B.

More patterns

There are many more patterns in the Pythagorean Triples!
For instance there are primitive triangles whose longest side and hypotenuse differ by 2, such as 8, 15, 17 and 12, 35, 37 and many more. What is the mathematical pattern in these triples?

Another idea is to take the formula and find special cases, remembering that the formula does not generate all Pythagorean triples.
For instance, let n=1. We then have triples m2–1, 2m, m2+1, although we have to make the restriction that m>1 for the hypotenuse to be a positive number:

nmm2–12mm2+1
12345
138610
1415817
15241026
16351237
Notice that not all of these are primitive and also that there are other triples with a side two less than the hypotenuse that are not in this list.

Can any number be a side in some Pythagorean Triangle?

Note that here we use the terms leg, side, hypotenuse as follows: there are two legs and a hypotenuse making the 3 sides of each Pythagorean triangle.

The Number of Pythagorean Triangles having a side n

These sequences are the counts for n=1, 2, 3,... in each of the 6 categories:
so that 0, 0, 1, 1, 2,.. means 0 triangles for n=1, 0 for n=2, 1 for n=3, 1 for n=4, 2 for n=5 etc.
PrimitiveAll
as a legA024361
0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 2, 1,..
A046079
0, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 4, 3,...
as a hypotenuse A024362
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,...
A046080
0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0,...
total A024363
0, 0, 1, 1, 2, 0, 1, 1, 1, 0, 1, 2, 2, 0, 2, 1,...
A046081
0, 0, 1, 1, 2, 1, 1, 2, 2, 2, 1, 4, 2, 1, 5, 3,...
It looks like every fourth number after 2, namely 6, 10, 14, 18,... cannot be the side of a primitive triangle.
Also you might guess that there are no gaps in the list of numbers that can be a side of at least one triple.
These are indeed true.
So the answer to our question Can any number be a side in some Pythagorean Triangle? is Yes - except for numbers 1 and 2.
From the table above, we can make an ordered list of the numbers themselves that can appear as sides in each category.

If we look for triples with a side that is a power of 2, we find:

The Possible Sides of Pythagorean Triangles

Here the actual sides are listed. If there is more than one possible Pythagorean triangle with a given side, the side is repeated in these sequences. The sequence of possible side lengths without repetitions is given in brackets.
PrimitiveAll
Legs 3, 4, 5, 7, 8, 9, 11, 12, 12, 13, 15, 15, 16,...
A024355 (A042965)
these are all the numbers except those
of the form 4n + 2 = 2, 6, 10, 14, ...
3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 11, 12, 12, 12, 12, 13, 14,...
A009041
this contains every integer>2
Hypotenuses 5, 13, 17, 25, 29, 37, 41, 53, 61, 65, 65,...
A020882 (A008846=A002144)
these are the integers that have all their prime factors
of the form 4n + 1
5, 10, 13, 15, 17, 20, 25, 25, 26,...
A009000 (A009003)
these are the integers that have at least one prime factor
of the form 4n + 1
Sides 3, 4, 5, 5, 7, 8, 9, 11, 12, 12, 13, 13,...
A024357 (A042965)
this is every number except those of the form
4n + 2 = 2, 6, 10, 14, ...
3, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 12, 12, 12, 12, 13, 13,...
A009070
this series includes every integer>2
It is fairly easy to show that prime numbers are the sides a unique primitive Pythagorean triangle (with thanks to Alf Gunnarsson for pointing this out to me).
All odd numbers are the difference of two squares since (n+1)2 - n2 = 2n + 1.
All prime numbers after 2 are odd so they are also the difference of two squares, however this is only possible in one way since
m2 − n2 = (m + n)(m − n).
Since prime numbers have only two factors namely 1 and the number itself, then m − n must be 1 and this solution is unique. So m = n+1 and m+n is 2n+1, the prime number.
All primitive Pythagorean triangles fit the pattern m2-n2, 2mn, m2+n2
All primes except 2 are odd so cannot be the side 2mn and are therefore the difference of two squares, which, we have just shown, is possible in only one way.
The conditions on m and n to generate a PPT are that they should be of opposite parity as we saw earlier. The m,n pairs for PPT with a prime leg are of the form n+1,n. One of these must be odd and the other even so the m,n pairs n+1,n where 2n+1 is prime.
prime=
2n+1
nm=
prime-n
PPT
3123,4,5
5235,12,13
7347,24,25
115611,60,61
136713,84,85
178917,144,145
Since n+1,n generate these PPTs, the second leg is 2mn = 2(n+1)n which will always be larger than (n+1)2−n2=2n+1 for n≥0 so the prime side will be the smallest and the second leg and hypotenuse will be consecutive numbers.
If m=n+1 and 2n+1 is prime, m,n generate the PPT 2n+1 = prime, 2(n+1)n, 2n2+2n+1

There are also non-prime numbers that are the sides of just one PPT too: 4 in 3, 4, 5 and 8 in 8, 15, 17.
There is more about finding squares that sum of any number later on this page.

Number Series in Pythagorean Triangles

Other series of interest here are:

Graphs of the Primitive Triples

 

We can plot the Pythagorean triangles on a graph in a natural way as x-y coordinates if we use the two legs are the coordinates.
The hypotenuse is then the distance of the point from the origin.

Plotting all Pythagorean Triangles

graph  

If we plot all Pythagorean triangles with a leg up to size 100 we get the graph shown here:

Since each triple a b h is the same triple as its 'reflection' b a h, each triple is plotted twice, the reflections of the black points being in red.
The prominent straight lines are the multiples of the smaller Pythagorean triangles 3 4 5 in black and 4 3 5 in red.

There are more straight lines through the origin if we plot more triples:
The lines of points are densest for the multiples of the smaller (primitive) Pythagorean triples, so next we see 5 12 13 and so on:


Plotting the Primitive Pythagorean triangles

graph If we plot just the primitive Pythagorean triangles, the straight lines disappear and something else interesting appears. The curved lines are even clearer on this


The UAD Tree of Primitive Pythagorean Triangles

The UAD Tree
growing to the right!
3 4 5U 5 12 13U 7 24 25
A 55 48 73
D 45 28 53
A 21 20 29U 39 80 89
A 119 120 169
D 77 36 85
D 15 8 17U 33 56 65
A 65 72 97
D 35 12 37
We can organise all the primitive triangles into a kind of genealogical tree starting from 3 4 5. The "tree" grows to the right and each node in the tree has exactly 3 descendants, called Up, Along and Down, or U,A and D for short.

Each "descendant" triple is generated by a different transformation of the "parent" triple a b h on its left as follows:
E.g: 3 4 5
Starting from a, b, h goUpto: a – 2b + 2h, 2a – b + 2h,  2a – 2b + 3h 5 12 13
goAlongto: a + 2b + 2h, 2a + b + 2h,  2a + 2b + 3h 21 20 29
goDownto:–a + 2b + 2h, –2a + b + 2h, –2a + 2b + 3h 15 8 17

The article by Hall (see end of this section) proves that every primitive triple is in this tree and that the tree contains only primitive triples.
4 3 5U 8 15 17
A 20 21 29
D 12 5 13
If we swop a and b in any triple then the three U, A and D transformations still produce the same three triples but the Up and Down triples have swopped places and in all three the two legs a and b have swopped places too.

The m,n generators in the UAD tree

The m,n values
2,1U 3,2U 4,3
A 8,3
D 7,2
A 5,2U 8,5
A 12,5
D 9,2
D 4,1U 7,4
A 9,4
D 6,1
Twenty years after Hall's article about the UAD tree, other investigators found there is a set of simpler transformations that produces the same tree as Hall's but using the m,n generators for each triple as follows:
Starting from the triple with generators m,n on the left we have:
m,n goUpto 2m – n,m
goAlongto2m + n,m
goDownto m + 2n,n


The UAD tree Calculator

For any primitive triple, this calculator will
C A L C U L A T O R

a: b: h:

R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci The UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

/ You Do The Maths...

  1. Find the paths to the triples with consecutive legs: 20 21 29, 119 120 169 , ...
  2. What paths take us to the triples with hypotenuse one greater than a leg: 3 4 5, 5 12 13, 7 24 25, ...?
  3. What property have all the triples with paths D, DD, DDD, DDDD, ....?
  4. From any triple in the tree, on which branch is another with the same difference between
    1. hypotenuse h and the side b?
    2. hypotenuse h and side a?
    3. sides a and b?

Other triangle properties

Perimeter

3, 4, 5 triangle If I have a piece of string of length n, how many right-angled triangles can I make from it if the sides have integer lengths? The diagram here shows the only configuration if the rope has length 3+4+5=12. The length of the rope is the perimeter of the triangle.

The perimeter of a triangle a b h is the sum of the lengths of the sides a+b+h. Since the sides of Pythagorean triangles are integers, so is the perimeter.

You can use the Calculator (opens in a new window) to find all Pythagorean triangles with longest side up to 100, together with the length of the perimeter P and its area A:

All Pythagorean Triples with sides up to 100
arranged in order of hypotenuse (longest side):
with Perimeter (a+b+h)
TriadPrimitive? Perimeter
3, 4, 5primitive12
6, 8, 103, 4, 524
5, 12, 13primitive30
9, 12, 153, 4, 536
8, 15, 17primitive40
12, 16, 203, 4, 548
15, 20, 253, 4, 560
7, 24, 25primitive56
10, 24, 265, 12, 1360
20, 21, 29primitive70
18, 24, 303, 4, 572
16, 30, 348, 15, 1780
21, 28, 353, 4, 584
12, 35, 37primitive84
15, 36, 395, 12, 1390
24, 32, 403, 4, 596
9, 40, 41primitive90
TriadPrimitive? Perimeter
27, 36, 453, 4, 5108
30, 40, 5010× 3, 4, 5120
14, 48, 507, 24, 25112
24, 45, 518, 15, 17120
20, 48, 525, 12, 13120
28, 45, 53primitive126
33, 44, 5511× 3, 4, 5132
40, 42, 5820, 21, 29140
36, 48, 6012× 3, 4, 5144
11, 60, 61primitive132
39, 52, 6513× 3, 4, 5156
25, 60, 655, 12, 13150
33, 56, 65primitive154
16, 63, 65primitive144
32, 60, 688, 15, 17160
42, 56, 7014× 3, 4, 5168
48, 55, 73primitive176
TriadPrimitive? Perimeter
24, 70, 7412, 35, 37168
45, 60, 7515× 3, 4, 5180
21, 72, 757, 24, 25168
30, 72, 785, 12, 13180
48, 64, 8016× 3, 4, 5192
18, 80, 829, 40, 41180
51, 68, 8517× 3, 4, 5204
40, 75, 858, 15, 17200
36, 77, 85primitive198
13, 84, 85primitive182
60, 63, 8720, 21, 29210
39, 80, 89primitive208
54, 72, 9018× 3, 4, 5216
35, 84, 915, 12, 13210
57, 76, 9519× 3, 4, 5228
65, 72, 97primitive234
60, 80, 10020× 3, 4, 5240
28, 96, 1007, 24, 25224
Pythagorean Triangles with Equal Perimeters

Almost all the triangles which share a perimeter with others are non-primitive.
For Primitive Pythagorean Triangles we have quite different results.
The first primitive Pythagorean triangles with the same perimeter are 195, 748, 773 and 364, 627, 725 with a perimeter of 1716. The next such perimeters are 2652, 3876, 3960, ... A024408 and we have to go up to a perimeter of 14280 before we find three primitive triangless with the same perimeter: 119, 7080, 7081 and 168, 7055, 7057 and 3255, 5032, 5993. with the next perimeter being 72930 for 2992, 34905, 35033 and 7905, 32032, 32993 and 18480, 24089, 30361. See also

Area

The area of Pythagorean triangle a, b, h is just half the product of the two legs (the sides that make the right-angle) ab/2.

Since we halve the product of the two legs of the triangle, we can ask:

Is the area always an integer for Pythagorean triangles?
If we can have two odd legs in a Pythagorean triangle then the answer is no.
The true answer is always Yes because:
From the m,n formula above, one side is 2mn if primitive or else a multiuple of this if not primitive so there is always one side which is even.

In the table above 3 4 5 is the only triangle with an area smaller than its perimeter.

We can find two triples with a perimeter equal to its area:
6 8 10 has P=24 and A=24 and 5 12 13 has P=30 and A=30 (primitive)

Triangles with an area twice their perimeter are:
12 16 20 has P=48 and A=96
10 24 36 has P=60 and A=120
9 40 41 has P=90 and A=180 (primitive)

All Pythagorean Triples with sides up to 100
arranged in order of hypotenuse (longest side):
with Area ab/2
TriadPrimitive? Area
3, 4, 5primitive6
6, 8, 103, 4, 524
5, 12, 13primitive30
9, 12, 153, 4, 554
8, 15, 17primitive60
12, 16, 203, 4, 596
15, 20, 253, 4, 5150
7, 24, 25primitive84
10, 24, 265, 12, 13120
20, 21, 29primitive210
18, 24, 303, 4, 5216
16, 30, 348, 15, 17240
21, 28, 353, 4, 5294
12, 35, 37primitive210
15, 36, 395, 12, 13270
24, 32, 403, 4, 5384
9, 40, 41primitive180
TriadPrimitive? Area
27, 36, 453, 4, 5486
30, 40, 5010× 3, 4, 5600
14, 48, 507, 24, 25336
24, 45, 518, 15, 17540
20, 48, 525, 12, 13480
28, 45, 53primitive630
33, 44, 5511× 3, 4, 5726
40, 42, 5820, 21, 29840
36, 48, 6012× 3, 4, 5864
11, 60, 61primitive330
39, 52, 6513× 3, 4, 51014
25, 60, 655, 12, 13750
33, 56, 65primitive924
16, 63, 65primitive504
32, 60, 688, 15, 17960
42, 56, 7014× 3, 4, 51176
48, 55, 73primitive1320
TriadPrimitive? Area
24, 70, 7412, 35, 37840
45, 60, 7515× 3, 4, 51350
21, 72, 757, 24, 25756
30, 72, 785, 12, 131080
48, 64, 8016× 3, 4, 51536
18, 80, 829, 40, 41720
51, 68, 8517× 3, 4, 51734
40, 75, 858, 15, 171500
36, 77, 85primitive1386
13, 84, 85primitive546
60, 63, 8720, 21, 291890
39, 80, 89primitive1560
54, 72, 9018× 3, 4, 51944
35, 84, 915, 12, 131470
57, 76, 9519× 3, 4, 52166
65, 72, 97primitive2340
60, 80, 10020× 3, 4, 52400
28, 96, 1007, 24, 251344
The possible areas of a Pythagorean triangle are 6,24,30,54,60,84,96,... (A009112)
which Mohanty and Mohanty (see reference in the next paragraph) call Pythagorean numbers.
The areas of primitive triangles are 6,30,60,84,180,... (A024365)
which they call primitive Pythagorean numbers.
They also prove that

/ You Do The Maths...

The Calculator later on this page (opens in a new window) is useful for the following.
  1. * For which n is there always a Pythagorean triangle with an area n times its perimeter?
  2. * For which n is there always a primitive Pythagorean triangle with an area n times its perimeter?
  3. Find two Pythagorean triangles with the same area. [Check your answers with A009127.]
  4. Find the first few areas that are common to exactly two Pythagorean triangles.
    [Hint: The numbers in A009127 will help with this and the next two Problems.]
  5. Find three Pythagorean triangles with the same area.
  6. What about four?
  7. What is the smallest area common to 2, 3, 4, ... Pythagorean triangles?
    [ Check your answer with A094805 ]
  8. 3,4,5 trinagle If I have a piece of string of length 12 I can only make one Pythagorean triangle from it, namely 3,4,5.
    There is also just one Pythagorean triangle if the string was of length 24.
    How does the series of string lengths that begins 12, 24, continue if there is a unique Pythagorean triangle with that perimeter?
  9. A string of length 60 gives me two possible triangles with perimeter 60. What are they?
  10. We have just seen that the smallest length of string that can be the perimeter of just one Pythagorean triangle is 12.
    What is the smallest length that makes just two triangles? What about three? And four?
    [Check your answer with A098714]
  11. Find the Pythagorean triangles with areas 2×3×4, 3×4×5, 4×5×6, ... i(i+1)(i+2), using the Calculator later on this page. You can enter the area as, for example, 3*4*5.
    What do you notice about the m,n generating values for each? Prove your conjecture is true for the general case.
* The answers to 1 and 2 are found in:

The ratio of Area to Perimeter

In the Table above we list some Pythagorean triangles together with their Perimeter and Area.
For 3, 4, 5 if we expand it by a factor k we have
3k, 4k, 5k, Perimeter P = 12 k and Area A = 6 k2 so that A/P = k/2. Hence we can find a triangle with any whole number (and half any odd number) as the ratio A/P .
The situation is more easily explained by seeing that
In the Pythagorean triangle a, b, h the perimiter a+b+h is always a factor of a b.
Alfred and Dominic Vella prove this in their online article More Properties of Pythagorean Triangles. Since the area is a b/2 then we will always find whole numbers and some halves in the ratios of Area to Perimeter.

There is always at least one pythagorean triangle with any given whole-number ratio. We will demonstrate this below.

Paul Cleary of Oxford (UK) wrote to me in October 2013 to say that there are only 6 pythagorean triangles that have a given prime number as the ratio A/P. It seems there are always more than 6 when the ratio is a composite number for a ratio of 5 or more.
For example, for ratios up to 8, we only have the following PTs:

All Pythagorean Triangles with a ratio A/P from 1 to 8
PT=g×PPTg PPTm,n of PPTAPA/P
5, 12, 1315, 12, 133, 230301
6, 8, 1023, 4, 52, 12424
9, 40, 4119, 40, 415, 4180902
10, 24, 2625, 12, 133, 212060
12, 16, 2043, 4, 52, 19648
13, 84, 85113, 84, 857, 65461823
14, 48, 5027, 24, 254, 3336112
15, 36, 3935, 12, 133, 227090
16, 30, 3428, 15, 174, 124080
18, 24, 3063, 4, 52, 121672
20, 21, 29120, 21, 295, 221070
17, 144, 145117, 144, 1459, 812243064
18, 80, 8229, 40, 415, 4720180
20, 48, 5245, 12, 133, 2480120
24, 32, 4083, 4, 52, 138496
21, 220, 221121, 220, 22111, 1023104625
22, 120, 122211, 60, 616, 51320264
24, 70, 74212, 35, 376, 1840168
25, 60, 6555, 12, 133, 2750150
28, 45, 53128, 45, 537, 2630126
30, 40, 50103, 4, 52, 1600120
25, 312, 313125, 312, 31313, 1239006506
26, 168, 170213, 84, 857, 62184364
27, 120, 12339, 40, 415, 41620270
28, 96, 10047, 24, 254, 31344224
30, 72, 7865, 12, 133, 21080180
32, 60, 6848, 15, 174, 1960160
33, 56, 65133, 56, 657, 4924154
36, 48, 60123, 4, 52, 1864144
60, 32, 6848, 15, 174, 1960160
29, 420, 421129, 420, 42115, 1460908707
30, 224, 226215, 112, 1138, 73360480
32, 126, 130216, 63, 658, 12016288
35, 84, 9175, 12, 133, 21470210
36, 77, 85136, 77, 859, 21386198
42, 56, 70143, 4, 52, 11176168
33, 544, 545133, 544, 54517, 16897611228
34, 288, 290217, 144, 1459, 84896612
36, 160, 16449, 40, 415, 42880360
40, 96, 10485, 12, 133, 21920240
48, 64, 80163, 4, 52, 11536192
The counts of the number of PTs with an Area/Peri ratio of k for k from 1 is:
2, 3, 6, 4, 6, 9, 6, 5, 10, 9, 6, ... A156688

For the ratio k=8 there are only 5 PTs but for all larger ratios there are a minimum of 6 PTs.
A little algebra will show you that all the following 6 pythagorean triangles have a ratio A/P = k for any value of k and they are all distinct PTs if k>8:

6 Pythagorean Triangles with A/P=k
PTPerimetergPT/g=PPTm,n for PPT
6k, 8k, 10k24 k2k3,4,52, 1
5k, 12k, 13k30 kk5,12,133, 2
8 + 4k, 4k + k2, 8 + 4k + k216 + 12k + 2k2 1 if k = 4K ± 1
4 if k = 4K + 2
8 if k = 4K
same
3 + 8K + 4K2, 4 + 4K, 5 + 8K + 4K2
1 + 2K, 2K + 2K2, 1 + 2 K + 2K2
k + 2, 2
2K + 1, 1
K + 1, K
4 + 4k, 4k + 2 k2, 4 + 4k+ 2 k28 + 12k + 4k2 4 if k = 2K
2 if k = 2K + 1
1 + 2K, 2K + 2K2, 1 + 2K + 2K2
3 + 8K + 42K2, 4 + 4K, 5 + 8K + 42K2
K + 1, K
k + 1, 1
2 + 4k, 4k + 4k2, 2 + 4k + 4k2 4 + 12k + 8k2 2 1 + 2k, 2k + 2k2, 1 + 2k + 2k2 k – 1, k
1 + 4k, 4k + 8 k2, 1 + 4k + 8 k22 + 12k + 16k2 1same2k + 1, 2k
These numbers also hide another pattern. If we let A/P = k
and we saw above that a general PT is d times a PPT which can be generated using the m,n formula so that:
A general PT is
a = d (m2 – n2),
b
= d 2 m n,
h
= d (m2 + n2)
Area = k =  a b=d(m – n)n
Perimeter2(a+b+h)2
A bit of algebra will show that (a - 4 k) (b - 4 k) = 8 k2
which leads to a nice algorithm that Paul Cleary found for computing all the PTs for a given ratio k: For example, let's find those PTs with k = 5
The pairs of factors of 8 k2 = 8×25 = 200 are 1,200 2, 100 4, 50 5, 40 8, 25 10, 20
Add 4k=20 to each factor:
which are the legs of all the 6 PTs with
k = 5
21,220 22,120 24,70 25,60 28,45 30,40
Hypotenuses221 122 74 65 53 50
Now we can see that, as Paul Cleary found, that
the minimum number of PTs is 6 when the ratio k is prime.
The factors of 8k2 are then only the 6 pairs: 1×8k2,  2×4k2,  4×2k2,  8×k2,  k×8k,  2k×4k
If k = 1, 2, 4, or 8 then some of them will be duplicates.

The number of primitive pythagorean triangles with A/P ratio from 1 are given by:
1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, ..... A068068

Find PTs with a given Area/Peri ratio Calculator

C A L C U L A T O R

Pythagorean triples with Area/Peri ratio up to

R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

Altitude and the Reciprocal Pythagorean Theorem!

abH In this right-angled triangle with sides a, b, h, we have drawn in a line from the right-angle perpendicular to the hypotenuse, of length H. If the triangle's base is the hypotenuse then this is its height so that the area of the triangle is hH/2.
The two smaller triangles are therefore similar to the original triangle (same shape but different sizes) because the three angles of the original are the same three angles in the two smaller triangles.
So the ratio of the hypotenuse to the longer side will also be identical in all these triangles.

In the smallest triangle, this is a/H and in the original (largest) triangle this is h/b so we have:
a/H = h/b
and, dividing by a we have:
1/H = h/(a b)
Squaring this we have:
1/H2 = h2/(a2 b2)
but Pythagoras' Theorem tells us that a2 + b2 = h2 so we have
1/H2 = (a2+b2)/(a2b2)
or
1 = 1 + 1
H2a2b2
which we can call the Reciprocal Pythagorean Theorem!
We have also shown that
H = 2 Area = ab
hh
H will not be a whole number generally but it will be for the non-primitive Pythagorean triangle h×(a,b,h) = (ha, hb, h2) when H = ab.

The product of the 3 sides

The perimeter is the sum of the three sides a+b+h. What about their product a×b×h?
This number does not seem to have any geometrical or practical significance in terms of the triangle but is of interest mathematically.

The products of the three sides of some small Pythagorean triangles are:

The list of side-products in order begins as follows:
60, 480, 780, 1620, 2040, 3840, 4200, ... (A057096).

In every Pythagorean triangle the following six facts are always true:

  1. one side is a multiple of 3
  2. one side is a multiple of 4
  3. so the product of the two legs is always a multiple of 12
  4. and the area is therefore always a multiple of 6
  5. one side is a multiple of 5
  6. so the product of all three sides is always a multiple of 3×4×5=60
So if we divide the sides-products by 60 we have 1,8,13,27,34,64,70,104,125,...(A057097).
This series contains all the cubes 13=1, 23=8, 33=27, ...

If we restrict ourselves to only primitive triangles, the ordered list of side-products is:
60, 780, 2040, 4200, 12180, 14760, 15540,... (A063011)
and the series as multiples of 60 is
1, 13, 34, 70, 203, 246, ... (A081752)

It is an "open question" (we do not know if the answer is Yes or No) whether the ordered series of products for all Pythagorean triangles has a repeated item in it or if all the products are in fact unique:-

The Incircle and Inradius

First we find three simple formula for the inradius, r, of a right-angled triangle. Then we will see how to find Pythagorean triangles with a given inradius and to count the number of triangles too.

Three formulae for the Inradius

triangle with incircle


We can draw a circle touching all 3 sides of any triangle, called the incircle with radius the inradius usually denoted by r and centre the incentre.
From the symmetry of the circle, a line from its centre to each vertex of the triangle will halve each of the angles in the triangle.

Lines from the incentre to the vertices (shown in gray here) divide the triangle into three smaller ones, each having the same height, r on a base of one side of the whole triangle.
The area of a triangle is one half of the base of the triangle times its height. So the three separate areas sum to the whole area:

area  = a r + b r  + c r = r a + b + c
2222
The sum of the sides of a triangle is the length of its perimeter and, since we have the perimeter halved in the formula we often find this expressed using the semiperimeter s:
area = inradius × semiperimeter = r s
We now have a simple formula for the inradius, r, of any triangle:
r  =   2 area  =  area
perimetersemiperimeter

incircle in right-angled triangle In a right-angled triangle, the area is just half the product of the two legs, a b / 2 or 2 area = a b so the formula for r is even simpler:
ra b
a + b + h
Since all primitive right-angled Pythagorean triangles can be derived using the m,n formula above, then, in terms of m and n we have
r  = (m2–n2) 2mn = (m2–n2) 2mn = (m–n)(m+n)2mn = (m–n)n
m2–n2 + 2mn + m2+n22m2 + 2mn2m(m+n)

r = (m – n) n


So we have, in primitive right-angled triangles, the inradius, r is therefore always an integer because m and n are.
Non-primitive triangles are just multiples of primitives, so their inradius is an integer too. Therefore:

In all Pythagorean triangles, the inradius is a whole number

There is an even simpler formula for r:
Since we have a right-angled triangle, we can split the two legs into
a – r and r on side a and
b – r and r on side b.
These lengths a – r and b – r are duplicated on the two sections of the hypotenuse AB and indeed together make up the whole of AB. So we have

h = (a – r) + (b – r)
which we can rearrange to find a new expression for r:
r =  a + b – h
2

This also shows that the excess = (a+b) - h, which we met earlier, is 2r so the excess (a+b)−h is the diameter of the incircle.
It is a simple exercise now to check that r = (m – n) n by substituting the values for a, b, h from the m,n generator formula in the formula just found for r.

The two formulae for r in terms of the sides a, b, h were known to the Chinese mathematician, Liu Hui (approx dates: 220 - 280) and he writes about them in his commentary of the year 263 on an even older mathematical work called Nine Chapters on the Mathematical Arts which may even date back to 1000 BC!

Finding Pythagorean Triangles with a given Inradius

Here are a few Pythagorean triangles with small inradius r:
Primitive
TriplePerimeterArear
3,4,51261
5,12,1330302
7,24,2556843
8,15,1740603
9,40,41901804
11,60,611323305
12,35,37842105
13,84,851825466
20,21,29702106
Non-primitive
Triplemultiple ofPerimeterArear
6,8,103,4,524242
9,12,153,4,536543
12,16,203,4,548964
10,24,265,12,13601204
15,20,253,4,5601505
18,24,303,4,5722166
15,36,395,12,13902706
14,48,507,24,251123366
16,30,3415,8,17802406
From the table you can see that the number of Pythagorean triangles having an inradius of r=1 is 1, for r=2 it is 2, r=3 has 3 as do r=4 and r=5 but r=6 has 6 triples, and so on. This series of counts: 1, 2, 3, 3, 3, 6, ... is A078644.
For just the primitive triangles we have counts 1, 1, 2, 1, 2, 2, ... and the whole series is A068068.

The 3 4 5 triangle has an inradius of 1. So if we scale it up by a factor r, its inradius will become r also.
We have just shown that there is a non-primitive Pythagorean triangle with inradius r for all whole numbers r ≥ 2.
It is less obvious that there is a primitive Pythagorean triangle for each inradius r.
However, if you look carefully at the table above, you will find there is a particular primitive Pythagorean triangle with a specific pattern for each inradius from r= 1 to 6, and this should give you the clue you need to prove that there is always a primitive Pythagorean triangle with inradius=k for every whole number k. [Hint: you have already seen the pattern]

So we have our answer:

There is both a primitive and a non-primitive Pythagorean triangle with inradius r for any whole number r ≥ 2

Another curious fact is that there are exactly two primitive Pythagorean triangles with an inradius which is a given prime number >2.
For instance, and here the odd numbers have been included to help point out the pattern...

r=37 24 25 8 15 17
r=511 60 61 12 35 37
r=715 112 113 16 63 65
r=919 180 181 20 99 101
r=1123 264 265 24 143 145
r=1327 364 365 28 195 197
r=1531 480 481 32 255 257 and 2 others 39 80 89 and 48 55 73
r=1735 612 61336 323 325
.........

/ You Do The Maths...

The Calculator later on this page (opens in a new window) is useful for the following.
  1. Can you spot the two patterns here? What is the formula for each column of triples?
    You have therefore shown that there at least two Pythagorean triples for each odd r.
  2. Find the m,n generators for each of the two primitive triangles in the table above
  3. Can you show that the two triangles above for each prime r are both primitive?
  4. Find odd numbers of inradius for which there are more than 2 primitive triangles
  5. For which odd numbers r are primitive Pythagorean triangles above the only two?
  6. Do both patterns apply for even inradius r?
The full answer to all these questions is revealed in the next section but some of the fun of maths is trying to prove these things for yourself.

How many Primitive Pythagorean Triangles are there with a given Inradius?

We have seen in the Puzzles section above, that for an odd number as inradius, there are always at least two primitive Pythagorean triangles.

The number of primitive Pythagorean triangles with inradius from 1 to 100 is as follows, where the odd numbers are in red and the primes are in blue:

1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 4, 1, 2, 2, 2, 2,
4, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 1, 4, 2, 4, 2, 2, 2, 4, 2,
2, 4, 2, 2, 4, 2, 2, 2, 2, 2, 4, 2, 2, 2, 4, 2, 4, 2, 2, 4,
2, 2, 4, 1, 4, 4, 2, 2, 4, 4, 2, 2, 2, 2, 4, 2, 4, 4, 2, 2,
2, 2, 2, 4, 4, 2, 4, 2, 2, 4, 4, 2, 4, 2, 4, 2, 2, 2, 4, 2,
We see all the prime inradii have just 2 primitive triangles and all the odds after 1 have at least 2.
Are they all just 1, 2 or 4? Further investigation shows that there are 8 with inradius 105 and 165 and the next new value is 16.
Neville Robbins gives the exact formula T(r) for the number of primitive Pythagorean triangles with inradius r ≥ 2 as:
T(r) = 2 (number of distinct prime factors of r), if r is odd
T(r) = 2 (number of distinct prime factors of r) – 1, if r is even

For even numbers, we merely ignore the factor of 2 and count only the other prime factors.
Example: r = 105
105 = 3 × 5 × 7 and three distinct prime factors tells us there are 23=8 primitive Pythagorean triangles with inradius 105.
Example: r = 45
45 = 3 × 3 × 5 so it has 2 prime factors: 3 and 5.
The number of primitive Pythagorean triangles with inradius 45 is T(45) = 22 = 4. They are 91, 4140, 4141; 140, 171, 221; 92, 2115, 2117 and 115, 252, 277.
Example: r = 32
32 = 2 × 2 × 2 × 2 × 2, so 32 has no odd prime factors and T(32) = 20 = 1.

/ You Do The Maths...

The Calculator later on this page (opens in a new window) is useful for the following.
  1. What is the smallest number that is the inradius of 16 primitive Pythagorean triangles?
  2. The only numbers r where T(r) = 1 (numbers r which are the inradii of just one primitive Pythagorean triangle) are the numbers r = a power of 2.
    Which primitive Pythagorean triangles are they?

The smallest r which occurs in n primitive Pythagorean triangles is 1 (1 triangle), 3 (2 triangles), 15 (3 triangles) and the complete series starts 1, 3, 15, 105, 1155, ... A070826.
If we factorize these numbers we have 1, 3, 3×5, 3×5×7, 3×5×7×11, ... which, after 1, is just the product of the first n – 1 consecutive odd prime numbers.

Whenever we see a count of things which are powers of two, we generally find that the things counted are sets where each item may independently be in the set or not.

For instance, there are 8 baskets (sets) of fruit we can make if we can optionally include 3 pieces of fruit: an apple, an orange and a pear say. 23 gives 8 possible sets (baskets) which includes the empty set too:
{}, {apple}, {orange}, {pear}, {apple, pear}, {apple, orange}, {orange, pear}, {apple, orange, pear}
The number of Pythagorean triangles with a given inradius r depends on the prime numbers that are the factors of r.

Excircles

3 excircles Apart from the incircle and the circumcircle there are three more triangles defined by any triangle.
These are the circles outside the triangle that have all three sides, when extended, as tangents, called excircles.
If these three circle's radii are called ra, rb and rb and if the incircle's radius is r then all four are related by the formula:
1+1+1 = 1
------------
rarbrcr
We also have a relationship between these 4 radii and the area A:
r ra rb rc = A2
Also, if the triangle's sides are whole numbers, then so are the excircle radii (the exradii)!
In particular, for a PPT generated by m,n, the three exradii are:
n (m + n), m (m – n), m (m + n)
which proves that they are whole numbers because m and n are.


The circumcircle joining the vertices

circumcircle The incircle and the three excircles touch all three sides but the circumcircle touches all three vertices. Its centre is equidistant from all three vertices and, in a right-angled triangle, is found at the mid-point of the hypotenuse since that point is equidistant from the two ends of the hypotenuse and, by symmetry or geometrical arguments, that point is also the same distance from the other vertex at the right-angle.
The radius of the incircle is called the inradius and denoted r (as we saw above);
the radius of the circumcircle is called the circumradius and denoted R.

So Pythagorean triangles will have whole number circumradii only if the hypotenuse is an even number

Lines from the centre of the incircle to the vertices divide each angle into two.
Lines from the centre of the circumcircle perpendicular to each side divide those sides into two.


A more general Pythagorean Triple Calculator

This calculator will find Pythagorean triples for you, either primitive or all with any combination of sides with a fixed value or in a given range of values. You can find the actual triples or else just count the number found.
If you give a range of values, the total in that range can be counted (Total count of).
A separate count, with one count for each value in the range, is given if you select Separately count.
Sizes gives a list of those values in the range for which the requested type of triangle (all or primitive) exist. Values are repeated where there are different triples of the same size.
For example all (primitive and non-primitive) triangles with hypotenuse = 20 up to 30:

Since there are infinite number of PTs with any given side difference - see above on Hypotenuse and Longest leg are consecutive and The two legs are consecutive - these options are marked with the ∞ sign and an extra input box will appear for difference searches to limit the search to a given maximum side length.
Sizes reports the sizes (of the side|perimeter|area|inradius requested) in the given range, so that if a side|perimeter|area|inradius is found in more than one triple, it is reported once for each separate triple.
Show all lists all the triples found but if you want just one example use Show one.
The results are printed in the Results box, triples being given with their area, perimeter and inradius. Select and copy from this area to use the output as text or in other applications.

A General Pythagorean Calculator

Here is a generator of all things Pythagorean which can search for various conditions on the triangles sides and has some very fast counting algorithms for some cases.
C A L C U L A T O R
legs are a and b, hypot is h





  Pythagorean triangles with
=
up to

R E S U L T S


 

calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

Pythagorean Angles

We now turn our attention from the sides to the angles in a Pythagorean triangle.
We can call an angle (not a right-angle) in a Pythagorean triangle a Pythagorean angle. Since the triangle has integer sides, such angles have sine, cosine and tangent that are pure fractions ("rational").
We can start with any fraction, say 2/3, as the tangent of an angle α and use it to generate a Pythagorean triangle which has as an angle using the formula
tan 2α =  2 tan α
1 – tan2 α
So tan α = 2/3 gives tan 2α = 5/12 so the Pythagorean triangle generated has legs 5 and 12 and hypotenuse 13.
If tan α = n/m then tan 2α = 2mn/(m2–n2).
tan α = n/m if and only if tan 2α = 2mn/(m2–n2).
Also, if α and β are Pythagorean angles, then so are α + β and α – β.
If α and β are Pythagorean angles, then let tan( α ) = n    and   tan( β ) = N
mM
then
tan( α + β ) = n M + m N
m M – n N
tan( α – β ) = n M – m N
m M + n N

Finding a Pythagorean Triangle approximating a given Angle

Can we find a Pythagorean triangle with a given angle? Sometimes this may not be possible with small numbers but we will always be able to find some Pythagorean triangles with an angle almost equal to any angle you require.

Here is a Calculator to find a primitive triangle with better and better approximations to a given angle. It only generates primitive triangles since all its multiples have identical angles but bigger sides.

You can use Pi in the input box e.g. for the angle π/3 (radians).
If you want Pythagorean triangles with a specific ratio of sides, e.g. 1/3, then use a function to find angle with a given sine or cosine or tangent.
These are called the inverse trigonometric functions arcsine, arccosine and arctangent often abbreviated to asin, acos and atan and, given the since, cosine or tangent find the associated angle as a small positive number.
Buttons for these inverse function are found on all but the most basic of calculators:

3   5
4
e.g. all of these describe the 3 4 5 triangle but don't forget they all find the angle in radians not degrees:
Remember that sines and cosines are in the range -1 to 1 so asin(15/8) gives an error
All of the above will find the 3, 4, 5 triple as will asin(4/5), acos(3/5), atan(4/3). Calculations are slightly more accurate if radian measure is used.

It turns out that the only angles that are a rational number of turns and that are angles in a Pythagorean triangle (that is, their sines and cosines are rational too) are the ones met at school:
30°=1/10 turns and 60°=1/5 turns and their sines and cosines are sin(30°)=cos(60°)=1/2 as well as 0° 90° and 180°.
So all rational number of turns will have to be approximated as an angle in a Pythagorean triangle. The Calculator below will show those approximations.

Find Pythagorean triangles with a given Angle Calculator

C A L C U L A T O R
with an angle of
a: b: h:

R E S U L T S


 
calculator: PT? a/b×c/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

Further Triple Patterns

The Pythagorean Triangle Angle Calculator above finds some interesting number patterns too.
For instance, there is no Pythagorean triangle with an angle of 45° (type in 45 into the "angle of..." box, make sure degrees is on and then click on the Find button) and if we ask the Calculator to find approximations it finds the sequence with legs differing by one that we found above.
If we try it on a series of angles such as 0.1, 0.01 and 0.001 radians, we discover two series of easily-remembered and visually striking patterns as in An easy method of writing down a series of triples above:
399 40 401  180 19 181
39999 400 4000119800 199 19801
3999999 4000 4000001 1998000 1999 1998001
399999999 40000 400000001 199980000 19999 199980001
Try it with 0.2, 0.02, 0.002 radians and you'll find at least two more patterns like this!
40 9 41 99 20 101
4900 99 49019999 200 10001
499000 999 499001999999 2000 1000001
49990000 9999 4999000199999999 20000 100000001
There are more complex patterns here too:
88501 17940 90301 -
899850001 17999400 900030001446930400 8939801 447019801
8999985000001 17999994000 90000030000014496993004000 8993998001 4497001998001
With 0.3, 0.03 and 0.003 there are patterns in the first four approximations:
12 5 1324 7 25
2112 65 21132244 67 2245
221112 665 221113222444 667 222445
22211112 6665 2221111322224444 6667 22224445

532 165 557391120409
55432 1665 5545739991 1200 40009
5554432 16665 55544573999991 12000 4000009
555544432 166665 555544457399999991 120000 400000009

The first triple in the final series is the one suggested by the rest of the pattern. It is indeed a Pythagorean triple -- check it with the Test a Triangle - is it Pythagorean? calculator above.

The series of angles 0.4, 0.04, 0.004 and 0.0004 radians generates:

12 5 13241026
1200 49 12012499 100 2501
124500 499 124501249999 1000 250001
12495000 4999 1249500124999999 10000 25000001
The 0.5 radians sequence gives:
-15 8 17
760 39 7611599 80 1601
79600 399 79601159999 800 160001
7996000 3999 799600115999999 8000 16000001
and with 0.6 radians and its tenths:
4 3 59160109
544 33 5459991 600 10009
55444 333 55445999991 6000 1000009
5554444 3333 555444599999991 60000 100000009

380261461
5436800 326601 5446601
55443668000 332666001 55444666001
555444366680000 333266660001 555444466660001

0.7 radians seems to give only one simple pattern:
351280449
39951 2800 40049
3999951 28000 4000049
399999951 280000 400000049
but 0.8 gives two:
-62450626
31000 249 3100162499 500 62501
3122500 2499 31225016249999 5000 6250001
312475000 24999 312475001624999999 50000 625000001
and 0.9 gives several:
435345
220 21 221264 23 265483 44 485
24420 221 2442124864 223 2486549283 444 49285
2466420 2221 24664212470864 2223 24708654937283 4444 4937285
246886420 22221 246886421 246930864 22223 246930865493817283 44444 493817285

202129485573319360481
2240 201 22496148 555 617339919360040081
222440 2001 222449617148 5555 6171733999919 36000 4000081
22224440 20001 2222444961727148 55555 61727173399999919 360000 400000081
2222244440 200001 22222444496172827148 555555 617282717339999999919 360000040000000081
0.010 will again give the first example above for 0.1.
However, do use the Calculator above and repeat the experiment. This time you will probably notice at least two more pattern series to add to your collection! How about 0.11, 0.011, 0.0011, ...
and then 0.12, 0.012, 0.0012, ...
and so on?
Also try 2/3, 2/30, 2/300, etc. (the Calculator handles expressions as input) or you can input it as 0.6666, 0.06666, 0.006666, etc. which has a one very simple pattern in particular.
You can also do this with any other (small) sequence of numbers making a decimal. Remember though that the biggest angle is 90° which is 1.57079632679489 radians.

The reason the patterns are so "obvious" above is that our numbers are written in base 10 and we are taking angles one-tenth as large each time.
An interesting mathematical Project is to find formulae for each of these series. It will then be easy to verify that all the triples in the series are Pythagorean by summing squares of the two legs and checking it equals the square on the hypotenuse.
You might even be able to find a formula that encompasses several of the series above.

What else can you find?
Email me at the address at the foot of this page and I'll add any interesting series of triples that you find, with your name.

Curious Connections

This section explores some of the curious connections between Pythagorean triangles and other mathematical topics. The places where they turn up is sometimes very surprising!

The 3 4 5 triple in an unusual guise

circle radius 3 and ring between radius 4 and 5 Here is a circle and a ring all with the same circle centres. The disc has radius 3 and the ring is between circles of radius 4 and 5.
Which is bigger (in area, that is, which would take more paint to colour it) - the disc or the ring?


disc radius 4 ring between radius 3 and 5
Try this variation: which is bigger this time - the disc or the ring?

Special Digit Triples

Side Reversals

The Pythagorean triple 88209, 90288, 126225 has two legs which are integers in reverse order.
There seems to be only one more with a hypotenuse less than 1,000,000: 125928, 829521, 839025
although you could also include 20691, 196020, 197109 and 82863, 368280, 377487.
What is the next? Can you find any more like this?

/ You Do The Maths...

  1. Find another triple with each leg being the reverse of the other leg ("legs" are the sides forming the right-angle). [The legs and the hypotenuse have 7 digits.]
    8053155 5513508 9759717
  2. 33 56 65 and 3333 5656 6565 have a hypotenuse which when reversed becomes a side.
    1. By multiplying the first triple by various values, write down several more.
      33 56 65 × 10 = 330 560 650
      33 56 65 × 100 = 3300 5600 6500
      33 56 65 × 101 = 3333 5656 6565
      33 56 65 × 1000 = 33000 56000 65000
      33 56 65 × 1001 = 33033 56056 65065
      33 56 65 × 1010 = 33330 56560 65650
      33 56 65 × 10101 = 333333 565656 656565
      33 56 65 × 10000 = 330000 560000 650000
      33 56 65 × 10001 = 330033 560056 650065
      33 56 65 × 10010 = 330330 560560 650650
      33 56 65 × 10101 = 333333 565656 656565
      ... Can you see the pattern in these multipliers? See A014417
    2. 1980 5265 5625 is a different example.
      How many more can you find with a hypotenuse less than 100000?
      5265 1980 5625
      43758 7344 44370
      12705 49104 50721
      33033 56056 65065
      59961 59248 84295
      55517 45144 71555
      51557 55176 75515

Prefix Triples

If we insert a "1" before the numbers in the triple 5 12 13 we get 15 112 113 which is also Pythagorean. The problem was posed and solved for a triangle with all sides less than 100 in ...
Both 5 12 13 and 15 112 113 are primitive too! Is this the only case?

Update 16 August 2013:
John McMahon has discovered that this prefix is part of a more general pattern for 5, 12, 13:

51213
15112113
25312313
35612613
4510121013
5515121513
The general pattern is ( n×10 + 5 )2 + ( n(n+1)×50 + 12 )2 = ( n(n+1)×50 + 13 )2.
The question is now, what other Prefix Patterns exist for other PTs?

There are other non-primitive solutions:

We can multiply these two triples by 10 or 100 or any power of 10 and still get a valid solution:
1 before 50,120,130 = 10 ×5,12,13150,1120,1130 = 10 ×15,112,113,
1 before 500,1200,1300 = 100 ×5,12,131500,11200,11300 = 100 ×15,112,113,
...
This applies to the following too:
1 before500,12495,12505=5×[100,2499,2501] 1500,112495,112505=5×[300,22499,22501]
1 before7500,21875,23125=625×[12,35,37] 17500,121875,123125=625×[28,195,197]
2 before600,1045,1205=15×[120,209,241] 2600,21045,21205=5×[520,4209,4241]
2 before600,11242,11258=2×[300,5621,5629] 2600,211242,212258=2×[1300,105621,105629]
3 before7500,11375,13625=125×[60,91,109] 37500,311375,313625=125×[300,2491,2509]
3 before9000,15675,18075=75×[120,209,241] 39000,315675,318075=30×[1300,105621,105629]
3 before900,16863,16887=3×[300,5621,5629] 3900,316863,316887=3×[1300,105621,105629]
Are there any Pythagorean triples formed by prefixing a number larger than 3 at the front of all sides?

Pythagorean Triples and Prime Numbers

What about the prime numbers as sides of a Pythagorean triangle? Clearly they only occur in the primitive Pythagorean triangles.
All the primitive triangles are generated by the m,n formula in which one side is 2 m n. So our prime number sides must be the odd side of a primitive Pythagorean triple (since there is no Pythagorean triangle with a side of 2) and/or the hypotenuse.
Here are some with the prime numbers shown like this:
Prim PTm,n
3452,1
512133,2
8 15174,1
724 254,3
20 21295,2
12 35376,1
9 40415,4
28 45537,2
1160616,5
48 55738,3
1384 857,6
39 80898,5
65 72979,4
 
Prim PTm,n
20 9910110,1
60 9110910,3
15 1121138,7
88 10513711,4
17144 1459,8
51 14014910,7
85 13215711,6
52 16517313,2
1918018110,9
9516819312,7
28 19519714,1

Book: In The new book of prime number records 3rd edition (1995) Springer-Verlag, P Ribenboim conjectures there are an infinite number of Pythagorean triangles with two prime number sides.

Pythagorean Triangles and Egyptian Fractions

Egyptian Fractions are a different way of writing fractions as used by the ancient Egyptians who built the Pyramids and before them the ancient Babylonians. They did not use the ratio of two whole numbers as we do, e.g. "four-fifths" or 4/5 which is the ratio of 4 to 5 and also the result of 4 divided by 5, of 4 things divided into 5 equal parts.
Instead they wrote fractions as a sum of unit fractions. For example 3/4 would be 1/2 + 1/4, a sum of two different fractions each with a numerator (top number) of 1.

Fractions which are the reciprocal of an integer (i.e. have a numerator of 1) are called unit fractions.

Every fraction a/b can indeed be written as a sum of distinct unit fractions and in many ways and these are called Egyptian Fractions.
The simplest kinds of fractions are those that can be written as a sum of two unit fractions.

For n=3
the number of ways is one since 2/3 = 1/2 + 1/6 is the only way to write 2/3 as the sum of two unit fractions.
For n=8
we have 2/8 which is, of course, 1/4 and we have two pairs of different unit fractions with this sum: 1/4 = 1/12 + 1/6 = 1/20 + 1/5 .

Surprisingly this number of ways to write 2/n as a sum of two different unit fractions is exactly the same as the number of Pythagorean triangles having n as a leg:

The number of ways we can write 2/n as a sum of two different unit fractions gives the series

n34567891011 12131415...
counts1 1 1 1 1 2 2 1 1 4 114...
Read more about this series:

Unit fractions for 2/n ⇔ Pythagorean Triangles with side n Calculator

C A L C U L A T O R

2/n unit fractions and Pythagorean triangles having a side n= up to
R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs
I have another page at this site to help you explore more

Pythagorean Triples and Fibonacci Numbers

The Fibonacci Numbers are a simple series of numbers that appear in lots of places in nature: 1, 2, 3, 5, 8, ... where each number is the sum of the previous two in the series.
Often mathematicians start this series with 0 and 1 and we get the series: 0, 1, 1, 2, 3, 5, 8, 13, 21, ... A000045.

Fibonacci Numbers as sides of Pythagorean triangles

It is easy to see that
there is no triangle with all 3 sides being consecutive Fibonacci numbers

We know of two Pythagorean triangles with 2 Fibonacci numbers as sides:
3 4 5
5 12 13
It is thought that there are no more but this remains an open question.

Although no Pythagorean triangles contain 2 Fibonacci numbers as separate sides, there is a series of Pythagorean triangles with many Fibonacci relationships where the m,n generators are successive Fibonacci numbers and each has a hypotenuse that is a Fibonacci number.

mnm2–n2 2mn m2+n2Area
21345=F(5)1.1.2.3 = 6
3251213=F(7)1.2.3.5 = 30
53163034=F(9)2.3.5.8 = 240
85398089=F(11)3.5.8.13 = 1560
 
Fi+1 Fi Fi+2Fi–1
=Fi+12–Fi2
2 FiFi+1
=F2i+2–Fi+12
F2i+1
=Fi2+Fi+12
Fi–1FiFi+1Fi+2
A121646 A079472 A001519 A228873
The perimeter of each is equal to the length of the longest leg in the next triangle.
Not all Fibonacci numbers can be a hypotenuse: there are no Pythagorean triangles with a hypotenuse of 2, 3, 8, 21, 144, 987, ... .

Areas and Fibonacci Numbers

In terms of the areas of Pythagorean triangles, Mohanty and Mohanty, mentioned earlier, use the term Pythagorean number for a whole number that is the area of a Pythagorean triangle. They showed that

Pythagorean Triples and Pi

y = number of PPTs with hyp<x graph
Use the buttons in this section to change the graph
Earlier we saw that of the number of primitive Pythagorean triangles with a hypotenuse less than N was virtually a straight line when plotted against N:
Since the "straight line" graph goes through the origin, we can also of (the number of primitive Pythagorean triangles with hypotenuse less than N) / N.
This ratio seems to be settling down to a particular value as N gets larger: what is this value?

Discovered by D N Lehmer in 1900 it is
1   =   1   =   1   =   0.1591549..
2×3.1415926..6.283185..

The number of primitive Pythagorean triangles
with hypotenuse less that N is approximately
N   =   0.1591549 N
2 π

For example, for N = 100, this approximation formula gives 0.1591549 × 100 = 15·92 primitive Pythagorean triangles with hypotenuse less than 100 whereas the exact value is 16.

But this is not the only relationship between Pythagorean triangles and π!

of the number of primitive Pythagorean triangles with a perimeter less than N is also a "straight line".
What is the ratio this time? Have a look at shown in the graph area above. Again it was D N Lehmer who proved that the limit of this ratio also involved π:

The number of primitive Pythagorean triangles with perimeter less than N is approximately
ln(2) N  =   0.07023 N
π2

ln(2) means loge(2), the natural log of 2, i.e. the number which, when e is raised to that power, gives 2.
Since e 0·693147... = 2 then ln(2) = 0·693147...
So
ln(2)  =  0·693147   =   0·693147  =  0·07023
π23·1415922 9·869604  

For example, Lehmer's formula for N = 1000 gives the value of 0·07023 × 1000 = 70.23 as the approximate number of primitive Pythagorean triangles with a perimeter less than 1000 whereas the exact value is 70: so it is not bad as an estimate!

It seems remarkable that π should appear in this context, but it does have an amazing tendency to appear in many formulae for approximations in different areas of mathematics.

Estimate the number of PPTs with hypotenuse or perimeter<N Calculator

C A L C U L A T O R
the number of primitive Pythagorean triangles with less than
R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot,perim sum sqs

Pythagorean Triples, the Fibonacci method and Formulas for Pi

On the Pi and the Fibonacci Numbers page we saw how to use the tangents of angles and a formula for finding the value of an angle given its tangent to compute π=3.14159... to as many (decimal) places as we want.
Starting from Euler's beautifully simple formula from 1738:
π = arctan 1 + arctan 1
423
we generalised it to find many others of the same form.

But Tim Schumacher of Christchurch, New Zealand sent me an email in Nov 2014 with a marvellous connection between the Fibonacci method above and such formulas for π.
If we take any starting values for the Fibonacci method, we found that a, b, a+b, a+2b generated the PT 2b(a+b), a(a+2b), b2 + (a+b)2. But each and every one of these leads to a formula for π too using the ratios of the middle two terms and the outer two terms as follows:

π = arctan a + arctan b
4a + 2 ba + b
Luo diagram It is not difficult to use the trig formula for the tangents of a sum of two angles to prove this is true but Tim with his student Dingcheng Luo found a wonderfully simple diagram generalising Ko Hayashi's diagram to prove it. It almost needs no words at all:
tan(α) = a
a + 2 b
tan(β) = √2 b = b
√2 (a + b) a + b
tan(α + β) = a + b = 1
a + b
Note that if all edges are the same length, say a = b = 1 then we get Euler's formula of 1738 seen above:
π = arctan1 + arctan1
423
so this is a generalisation of his result.

Pythagorean Triples and Partitions

Jack Garfunkel proposed that there is a relationship between partitions of a number (the number of ways we can write that number as a sum of positive integers) and Pythagorean triples:
P3(a) + P3(b) = P3(h) for any Pythagorean triple a, b, h
P3(n) is the number of ordered lists of 3 whole numbers whose sum is n i.e.
the number of ways of writing n as n = i + j + k for whole numbers i, j and k where 0 < i ≤ j ≤ k
For instance, we can only write 1 + 1 + 1 to make 3, so this list is the only one: P3(3) = 1.
For 4 we again have only one list: 1 + 1 + 2 = 4 so P3(4) = 1.
There are two solutions for 5 since 5 = 1 + 1 + 3 = 1 + 2 + 2 so P3(5) = 2.
Find all the sums-of-3 that total 6, 7, 8, ... and check your results with this table:
n3456789101112...
P3(n)112345781012...
So Garfunkel's result is that since 3, 4, 5 is a Pythagorean triple then P3(3) + P3(4) = P3(5) and, indeed, from our table,
P3(3) = 1, P3(4) = 1 and 2 = P3(5) = P3(3) + P3(4) = 1 + 1 = 2.

Pythagorean or Babylonian?

Plimpton tablet
A tiny block of clay, about the size of a postcard (5 inches x 3.5 inches or 12cm x 9cm) with 15 rows of 4 columns of "numbers" is dated to about 1800 BC and so is probably the world's oldest surviving mathematical artefact. Plimpton 322 is one of 600 such tablets donated to Columbia University's Rare Book and Manuscript Library by George Plimpton and was item 322 in his catalogue, hence its name. (Have a look at their other treasures too.)

Bill Casselman's page on The Babylonian tablet Plimpton 322 from University of British Columbia has the best image of the tablet and an excellent explanation of how to read Babylonian numbers and what the tablet contains.

And what does it contain? A list of Pythagorean Triangles arranged in order of triangles which are approximately 1 degree apart! They are written in the Babylonian scale of base 60 and involve base 60 "fractions". Such tables were probably used in surveying.

Mansfield and Wildberger of UNSW Australia have found exact connections between the figures and how they can be used practically. See the references below for a short Youtube video and a link to the fuller explanation in their journal article.
However, some of this is a little "hyped" and Evelyn Lamb's article Don't Fall for Babylonian Trigonometry Hype in the Scientific American of August 2017 is a good review of these Youtube vides and their claims.

Pythagorean Jigsaws

Pythagorean Triangles in a Square

5 pyth tris in a square Can we divide a square into Pythagorean triangles? Charles Jepsen and Roc Yang showed that we could, with a minimum of 5 such triangles.
The smallest square with just 5 Pythagorean triangles that they found is shown here.
They prove also that there is no dissection of a square into just 4 Pythagorean triangles.
So they then ask the question
Is this the smallest square that can be dissected into five Pythagorean triangles?
It seems this question is still "open". Can you find the answer?

Amazingly, Penny Drastik, a primary student at The Illawarra Grammar School in Australia, aged 10, found 12 smaller solutions for squares of side less than 9000 including one which she thinks is the smallest square with this pattern of triangles [April 2008].

Penny also found one square (of side less than 9000) that can be dissected in two different ways with this pattern of triangles. I leave you with the challenge of finding the sides of the triangles and the square.

Can you find a smaller square, perhaps with a different arrangement of 5 triangles?

Squares with more than 5 Pythagorean Triangles?

Jepsen and Yang's articles (above) gives a beautifully simple argument that it is possible to dissect a square into any number of Pythagorean triangles, from 5 upwards.
We have the solution for 5 triangles (which they prove is the smallest number of Pythagorean triangles that we need to fill a square).
alt form hyp to right angle So take any one the Pythagorean triangles in any square's dissection and find the altitude from the right angle to the hypotenuse:
We have thus divided that Pythagorean triangle into two right angled triangles but these will only be Pythagorean if the new side's lengths h and w are integers. What are these two lengths in term of a, b, c?
Since the area of the triangle is ab/2 and also ch/2 then h = ab/c.
A small amount of algebra (left to the reader) shows that w = a2/c.
By symmetry, we also have c – w = b2/c
So h and w might not be integers unless c divides exactly into both a2, ab and b2.
But we can make them integers by expanding the whole square dissection containing the triangle by factor c!

Thus we obtain another square, c times larger, with an one Pythagorean triangle replaced by two. 5 pyth tris in a square

Interestingly, if we try this on the 5-triangle dissection above, we find the top triangle neatly divides into two with no expansion needed:

Clearly we can do this as often as we like to get squares with an ever increasing number of Pythagorean triangles in them.

There is always a square that can be dissected into n Pythagorean triangles for every n from 5 upwards
However, the triangle that is divided into two makes two smaller Pythagorean triangles both of exactly the same shape as the original, that is, the angles in the two new triangles are equal to those in the triangle that was split.
So we are guaranteed to have two or more Pythagorean triangles of the same shape in our jigsaw if we use this method.
Triangles with the same angles in each are called similar triangles; they need not be the same size but they do have the same shape.
Triangles with matching sides and angles are identical in both size and shape and are called congruent triangles.
Is it always possible to dissect a square into any number (≥ 5) of different (i.e. not similar) Pythagorean triangles?

Another proof of the Pythagoras Theorem

ABC, 90deg at C, altitude from B to AC Using the diagram above with the altitude (height) h marked in triangle a b c, we can find another proof of the Pythagoras Theorem a2 + b2 = c2:
  1. Show that the triangles ABC, CDB and ACD are all similar (that is, the same three angles occur in each)
  2. Identify the other two angles equal to the angle at A and the other two angles equal to the angle at B
  3. Find the sine of angle B in triangle BCD and the equivalent angle in ABC and its sine. Connect them with an equation involving b, c and c–w, b
  4. Find the cosine of angle B in triangle ABC and the equivalent angle in the third triangle, ADC, and its cosine. Connect them with an equation involving w, a, and a, c
  5. Rewrite your two equations so that there are no fractions by cross-multiplying if necessary
  6. Add the two equations so that one side is a2 + b2
  7. Can you show that the other side of the equation is now c2?

Pythagorean Triangles in a Circle

We can always draw a circle through any set of 3 points. There is a very nice animation of how to do this at Math Open Reference site. The method is easy and was given by Euclid's Elements Book 3, Proposition 1.
right angle in a semicircle However, something special happens for Pythagorean triangles because of the right-angle.
The circle through the three points of a right-angled triangle has its centre at the mid-point of the hypotenuse
In other words, pick a point on a circle and connect it to two ends of any diameter and the angle you have just made is always a right angle.
So if we can find several Pythagorean triangles with the same hypotenuse we can place them on the same diameter of a circle so that their right-angles will lie on the circle.
By orienting the triangles so that the smallest angles are all at one end of the diameter, the right-angles will lie on a quarter circle.
By duplicating each triangle with each non-right-angle at each end of the diagonal, the right-angles will all lie on a semi-circle.
By including the triangles twice on each side of the diagonal, the right-angles will lie on a circle.
And, because they are all Pythagorean triangles, the points on the circle will all have integer coordinates.
13 tris with hyp 1105 The simplest example is 7 24 25 and 15 20 25 which have a common hypotenuse of 25.
Clearly we can double all the lengths and treble them and get many more examples.
Here is a set of 4 with a common hypotenuse of 65: 16 63 65, 25 60 65, 33 56 65, 39 52 65
Can you find another set of 4 having a hypotenuse of 85?
There is a set of 3 all having a hypotenuse of 125 - which are they?
Can you find the surprising 7 having a hypotenuse of 325?
There are 13 with a hypotenuse of 1105 and 22 for 5525!
A004144 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 14, 16, ...
are the numbers that are not the hypotenuse of any Pythagorean triangle
A009003 5, 10, 13, 15, 17, 20, 25, 26, 29, 30, 34, 35
are the hypotenuses of Pythagorean triangles. So all integers are in the sequence A004144 or this one.
This series can be further split into the following classes.....
A084645 5, 10, 13, 15, 17, 20, 26, 29, 30, 34, 35, 37, 39, 40, 41, 45, 51, 52 ...
is the sequence of numbers which are the hypotenuses of a unique Pythagorean triangle.
A084646 25, 50, 75, 100, 150, 169, 175, 200, 225, 275 ...
is the sequence of numbers which are the hypotenuses of exactly 2 Pythagorean triangles.
A084647 125, 250, 375, 500, 750, 875, 1000, 1125, 1375, 1500, ...
is the sequence of numbers which are the hypotenuses of exactly 3 Pythagorean triangles.
A084648 65, 85, 130, 145, 170, 185, 195, 205, 221,...
is the sequence of numbers which are the hypotenuses of exactly 4 Pythagorean triangles.
A084649 3125, 6250, 9375, 12500, 18750, 21875, 25000, 28125, 34375, 37500,...
is the sequence of numbers which are the hypotenuses of exactly 5 Pythagorean triangles.
...
2, 3, 4, 5, 6, 7, 10, 12, 13, 16, 17, 22, 31, 37, 40, ...
are the only possible counts of the number of Pythagorean triangles with the same hypotenuse for hypotenuses up to 200,000. There are many numbers that are the hypotenuses of exactly 4 triangles, the next most frequent count being 2, then 13 and so on, with 160225 being the hypotenuse of 67 Pythagorean triangles. Up to a hypotenuse of 200,000 we cannot find a number that is the hypotenuse of exactly 8, 9 or 11 triangles. If we do not limit the size of triangles, then all numbers are possible as counts of Pythagorean triangles with the same hypotenuse according to A097756
A054994 5, 25, 65, 125, 325, 625, 1105, 1625, 3125, 4225, 5525, 8125, 15625, ...
is the list of smallest hypotenuses of exactly 1, 2, 3, ... Pythagorean triangles when the hypotenuses are arranged in order.
A006339 5, 25, 125, 65, 3125, 15625, 325, 390625, 1953125, 1625, 48828125, ...
these are the smallest hypotenuses of exactly 1, 2, 3, ... Pythagorean triangles in order of number of triangles, so 5 is the smallest hypotenuse of a single Pythagorean triangle, and 25 the smallest of exactly two triangles, etc.
A088959 5, 25, 65, 325, 1105, 5525, 27625, 32045, 160225, 185865, 5928325, 29641625, ...
are the record-breaking hypotenuses, that is a list of hypotenuses that occur in more Pythagorean triples than any smaller hypotenuse.
A088111 1, 2, 4, 7, 13, 22, 31, 40, 67, ...
are the counts of the record-breakers of the previous sequence (the number of triangles of which each is the hypotenuse)

Pythagorean Triangles in a Triangle

three 3 4 5 tris in a 90deg tri Earlier we saw how to split any Pythagorean triangle into two Pythagorean triangles which are similar to each other and also to the original (that is, the 3 angles in each triangle are the same: the triangles are called similar).
Here is a right-angled triangle split into 3 similar triangles. All have the 3 4 5 shape.
You can check this by dividing the sides by each of the factors shown in red in each right-angled triangle. We can make a diagram just like this containing three similar triangles derived from any Pythagorean triangle.
To show this, first in this diagram;
Label the sides of one triangle a, b and h;
Keeping the sides in the same proportions, and using the angles identified as being equal, label the other sides;
If you have any divisions, multiply the whole diagram by the divisors to make every side a product of a, b and h

/ You Do The Maths...

The investigations here would make an excellent topic for a Science Fair or Maths Project
  1. Can you make a right-angled triangle jigsaw with more than one shape of Pythagorean triangle?
  2. What about a jigsaw for a non-right-angled triangle?
  3. What is the largest number of right-angled triangle pieces you can fit into a triangular jigsaw?
  4. 4 similar PTs in a PT
    By looking at the earlier method we used to split one right-angled triangle into two, and comparing it with the diagram with three here, we can split a right-angled triangle into 4 right-angled pieces, all similar as shown here.
    Can you extend it again to five triangles? to six? and to as many as we like?
  5. Make you own patterns using one Pythagorean triangle in a range of sizes to make a nice tiling pattern as in the previous investigation question.
    Send some to me at the email address at the foot of this page and I will include them here.

Pythagorean Triangles in a Kite

kite kite A kite is a quadrilateral with two pairs of touching sides equal in length.

If we have right-angles where the unequal sides meet, we can make any Pythagorean triangle into a kite using three differently-sized copies of it as shown here.

What is the formula for the sides of the kite in terms of the Pythagorean triangle a b h?

What is special about the hypotenuse of the largest triangle (the vertical strut of the kite)?
top left is ah, aa, ab, bottom left is bh, ba, bb, right is ha,hh,hb The kite with 3 Pythagorean triangles can easily be transformed into a rectangle:


Pythagorean Triangles in a Rectangle

So now how about rectangles dissected into Pythagorean triangles?

The simplest method is to put two identical triangles together along their hypotenuses to make a rectangle:
So a rectangle can be dissected into two Pythagorean triangles if its sides are the two legs of a Pythagorean triangle. But both the triangles in this dissection are identical (congruent).
two tris in a rect
Here are two rectangles each containing three right-angled triangles. Show that in each diagram all the triangles are similar. 3 tris in a rect
In each of these two 4-triangle rectangle dissections find two similar triangles.

Can you find two more rectangular dissections into 4 right-angled triangles each with 4 similar triangles?

two rects of 4 tris two rects of 4 tris
two more rects of 4 tris

Can you find a rectangle that dissects into different (non-similar) Pythagorean triangles?

Pythagorean Triangles round a point

This section investigates putting 4 Pythagorean triangles round a point with their right-angles meeting at the point and other variations.

Four triangles with their right-angles meeting

Can we fit four Pythagorean triangles together round a point at which all the right-angles meet?
4 triangles meeting at their right-angles 4 congruent, 2 pairs of congruent You should find it easy to answer the question if you use these two diagrams on the left as guides.

However, what if the four triangles are all different as shown here on the right?
These shapes are quadrilaterals since none of their sides are equal in general.
The smallest perimeter is 176 and has two pairs of similar Pythagorean triangles if you want to find it for yourself and check your answer with this button:
The smallest solution (smallest perimeter) with 4 different Pythagorean triangles (that is, no two triangles are similar) has a perimeter of 950:

Three triangles with their right-angles meeting

3 meet at their right-angles in 3D If we try just three triangles meeting at their right-angles, we have to go into 3 dimensions.
The three triangles will meet as if in the corner of a room as shown here.

Again this is possible and the smallest perimeter is 636 so it is harder to find than the 4 different triangles meeting at a point of the previous section.

There is another interesting connection here:

The square of the area of the triangle formed from the 3 hypotenuses = the sum of the squares of areas of the three Pythagorean triangles
This theorem applies even if the 3 right-angled triangles were not Pythagorean.

More than 4 triangles with their right-angles meeting

5 meet at a corner We can fit more than 4 Pythagorean triangles together with their right-angles meeting at a point if we allow three to be flat "on the floor" and the other two to be perpendicular as if on two "walls".
Imagine looking at the corner of a building from outside and concentrate on the point where the two vertical walls meet the ground. The diagram shows a blue and green vertical wall at the corner on the red ground. Three triangles meet and lie flat on the ground; a fourth triangle is on the green vertical wall and the fifth is on the blue vertical wall, all 5 right-angles touching at the corner point where the three surfaces meet.

Can you imagine 6 meeting at a "corner"? What about 7 or 8? Are more possible?

More Pythagorean Puzzles

You Do The Maths...

The Calculator earlier on this page (opens in a new window) is useful for the following.
  1. Find the only two Pythagorean triangles with an area equal to their perimeter.
  2. Which are the only 3 numbers that cannot be the shortest side of any Pythagorean triangle?
    [Check your answer with A009005.]
  3. Find three consecutive numbers which can be the hypotenuses of Pythagorean triangles.
    Can you find four consecutive numbers which are hypotenuses?
    What about five? and how about a set of nine? [Check your answers with A099799.]
  4. Find a few Pythagorean triangles whose shortest side is a square number
    e.g. 9=32, 12, 15, and 25=52, 312, 313.
    Of the primitive ones in your list, what is special about their m and n values?
  5. A remarkable property of the m,n formula for triples: ( m2 – n2 )2 + (2 m n)2 = ( m2 + n2 )2 is illustrated in this puzzle:
    1. Find triples with a hypotenuse that is a square number H2.
      There are two triangles with a hypotenuse of 52=25 for instance: 15 20 25 and 7 24 25.
    2. List the values H that are squared to make these hypotenuses: where have you seen this series before on this page?
    3. It seems there are two triples for each and every hypotenuse that is a square number H2.
      1. One is easily explained as it has a simple relationship with the triple with hypotenuse H: what is that relationship?
      2. For the second, look at its generators to find a proof that it always exists.
    Can you guess how many triples there will be with a hypotenuse that is a fourth power: H4?
  6. Following on from the previous Puzzle, what can you find out about triples with a hypotenuse of the form H3?
  7. What about Pythagorean triples having a smallest side which is a cube?
    e.g. 27=33, 36, 45.
    What is special about their m and n values?
  8. How many Pythagorean triangles have a side of length 48?
    Find a number that can be the side of even more Pythagorean triangles. (Hint: there are 5 answers less than 100)
    1. What is the highest number of triples you can find with the same side in each?
    2. Which number less than 250 occurs in 32 triples?
  9. What is the smallest number that is the hypotenuse of more than one triple?
    What is the greatest number of triples you can find with the same hypotenuse?
    Is there one that is not a multiple of 5?
  10. Find some numbers which are the odd sides of more than one primitive Pythagorean triangle. The first two are
    1. 15: which is a side in both 8 15 17 and 15 112 113 and
    2. 21: which is a side of both 20 21 29 and 21 220 221.
    Can you find a property to describe the factorizations into primes of each number in this series?
    [Check your answer with A061346.]
  11. 33,44,55 is a triple where all the numbers are palindromes, that is, they are the same when written backwards.
    We can find a whole series of Pythagorean triples where all the numbers are palindromes:
    3,4,5
    33,44,55
    333,444,555
    ...
    Also we have the triple 303,404,505.
    What is the series of factors that has been used to generate these from 3 4 5?
    Another is 66,88,110 if we include an initial 0 in front of the hypotenuse: 66,88,0110.
    What about the Pythagorean triples 606,808,01010 and 666,888,01110?
    Can you find any more infinite series of palindromic Pythagorean triples?
    [Hint: You might find A057148 useful here.]
  12. 4/3/05 is a date and also a Pythagorean triple. There was another one that year ('05) - when was it?
    Assuming that the years are in this century and are just two digits long, when is the next Pythagorean Triple Date?
    How many other such days are there in this century?
    If the date is any set of 3 numbers that are a Pythagorean triple (that is, the numbers need not be in order), how many dates are there in one century?
    [Why not organise a 'Pythagoras Day' at your school/college/maths department on the next such date?]
  13. How about a special Pythagorean Triple Time in hours:minutes:seconds? How many are there in a whole day if we use a 24-hour clock with hours from 0 to 23?
  14. In the Easy method of writing down a series of Triples section, we found a formula for the pattern given there and used it with n = 10, 100, 1000, ....
    What pattern do you get with n = 20, 200, 2000, ...?
    ... and with n = 30, 300, 3000, ...?
  15. Find your own Pythagorean Triple Pattern not already mentioned in Further Triple Patterns above.
    Here is another way to do this.
    Think of a series of numbers that are like those in the lists above, e.g. from the 399, 40, 401 pattern we might think of hypotenuses that are in the series 901, 90001, 900001, ... . Plug these numbers into the Triples generator and see if any patterns emerge. The hypotenuse searches on 901 and 90001 give:
    • Triples with hypotenuse=901:
      1: 476, 765, 901 =17x[45, 28, 53] P=2142 A=182070 r=170 m=. n=.
      2: 424, 795, 901 =53x[15, 8, 17] P=2120 A=168540 r=159 m=. n=.
      3: 451, 780, 901 primitive P=2132 A=175890 r=165 m=26 n=15
      4: 60, 899, 901 primitive P=1860 A=26970 r=29 m=30 n=1
    • Triples with hypotenuse=90001:
      1: 600, 89999, 90001 primitive P=180600 A=26999700 r=299 m=300 n=1
    and another pattern jumps out:
    899, 60, 901
    89999, 600, 90001
  16. Find a formula for one of the patterns in the Further Triple Patterns.
  17. [from Ken Sullins, Empire State College] Can you find a formula for each of the sets of triples in the columns below?
    Hint: In each column, the first legs form an arithmetic sequence (that is, they increase by the same amount each time). But, looking at the other two sides, what else do you notice is common to all the triples in a column?
    ABCDEFGHI
    3, 4, 54, 3, 512, 5, 1315, 8, 1735, 12, 3740, 9, 4160, 11, 6124, 7, 2563, 16, 65
    5, 12, 138, 15, 1720, 21, 2921, 20, 2945, 28, 5356, 33, 6580, 39, 8936, 27, 4577, 36, 85
    7, 24, 2512, 35, 3728, 45, 5327, 36, 4555, 48, 7372, 65, 97100, 75, 12548, 55, 7391, 60, 109
    9, 40, 4116, 63, 6536, 77, 8533, 56, 6565, 72, 9788, 105, 137120, 119, 16960, 91, 109105, 88, 137
    11, 60, 6120, 99, 10144, 117, 12539, 80, 8975, 100, 125104, 153, 185140, 171, 22172, 135, 153119, 120, 169
    ...........................
  18. A farmer uses fencing panels all of the same size to cut off a right-angled corner of a field to form a triangular enclosure. Each side used a whole number of panels.
    1. When she dismantled the fence she found she could reuse it all to surround a square area exactly.
      What was the shortest length of the fence for which this is possible?
    2. If in addition to (a) she could also reuse all the panels to surround another cut-off corner but which had a different shape to the original, what is the smallest number of panels she would need now?
    3. Find the smallest ten numbers in the series of perimeters which are all answers to puzzle (a).
  19. A farmer had a right-angled triangular field that he sowed with grass seed.
    The next year he sowed a differently shaped right-angled triangular field with exactly the same amount of seed.
    1. What shapes could the two fields have been and what was the area?
    2. Is it possible to find yet a different shape for a third year with the same amount of seed?
      If not, find another 3 field shapes with the same area.
  20. In the Pythagorean Triangles in a Rectangle section above we found a dissection of a rectangle into 3 similar triangles (they all contained the same 3 angles) and one with 4 similar triangles.
    Find a dissection of rectangle into 5 similar triangles.
    What about 6?
    Is it possible to extend this to any number of similar triangles in a rectangle?

Sums of more than two squares

Let's generalize Pythagorean triples to sums of 2 or more squares whose sum is a square.
We saw earlier that not all numbers can be the hypotenuse of a PT but what if we summed more than two squares? Is it possible to write all numbers as a sum of squares? If so, what is the minimum number of square we need? If not, what numbers are missing?
12 + 22 + 22 = 32 if we allow squares to be repeated
22 + 32 + 62 = 72 with distinct squares
102 + 112 + 122 = 132 + 142 a nice pattern which generalises
62 = 12 + 52 + 162 = 22 + 32 + 72 is the smallest number which is the sum of two sets of 3 squares
But what about numbers other than squares? Can all numbers be the sum of some squares?
In fact, not all numbers are the sum of three squares, for instance 7 is not.
What about four squares? This is a famous problem studied by many great mathematicians of the past, including Gauss and Euler.
Every number is the sum of up to four squares.
These are the questions we ask in this section. First, here is a Calculator to help in your investigations.

A Sums of Squares Calculator

set
If you want unique squares in the sum, no number repeated and all numbers to be squared are in order, choose a set;
list
If repetitions are allowed and numbers to be squared are in order then choose list.
Each repeated number in a list is shown once with the number of repetitions as a subscript,
for example the list 1 1 2 4 4 4 is shown as
sequence
If you want to count every possibility of numbers to be squared, negative, zero and positive and every ordering of the numbers counted as a different solution, choose a sequence. Each sequence of numbers is reported once giving the numbers in order together with the number of permutations of those numbers.
For example: 0 ±2 ±2 ±5 has 2×2×2 = 8 ways of including the signs. The four numbers including the 0 and the two 2s can be permuted in 12 ways to make 12 different sequences of unsigned numbers:
0 2 2 5; 0 2 5 2; 0 5 2 2;
2 0 2 5; 2 0 5 2; 2 2 0 5; 2 2 5 0; 2 5 0 2; 2 5 2 0;
5 0 2 2; 5 2 0 2; 5 2 2 0
So there are a total of 8×12=96 signed number sequences of 4 numbers.
Here is a Calculator to help you investigate further:

Leave the numbers input box (the set/list length) empty for sets/lists of all lengths.
Sequences need a length which is the number of non-zero numbers.
When giving a list of numbers to square and add, use ~ to indicate a range, for example 2~5 means 2,3,4,5.
Sums of Squares C A L C U L A T O R

all of numbers whose squares sum to
up to
the squares of
R E S U L T S


 
calculator: PT? a/bc/d=2 m,n Fibonacci UAD tree Area/Peri General a given Angle 2/n Unit
fractions
hypot
perim
sum sqs

Number Patterns

Some nice patterns in these sums of squares are the following:
32 + 42 = 52
102 + 112 + 122 = 132 + 142
212+ 222+ 232+ 242 = 252+ 262+ 272
362+ 372+ 382+ 392+ 402 = 412+ 422+ 432+ 442
...
On each line the total on each side is 25, 365, 2030, 7230, ... ,
n(n+1)(2n+1)(12n2+12n+1)
6
, ... A059255
The left hand sides start with the squares of 3, 10, 21, 36, 55, ..., n(2n + 1), ... A014105
and end with 4, 12, 24, 40, 60, ..., 2n(n+1), ... A046092.
The n squares on the right hand sides start with the squares of 5, 13, 25, 41, 61, ..., 2n(n+1) + 1, ... A001844 and end with the squares of 5, 14, 27, 44, 65, ..., n(2n+3), ... A014106.

All numbers are a sum of up to 4 squares

Lagrange in 1770 proved that, if we allow 0 as a square then every number is the sum of exactly four squares. This is the same as saying every number has a representation as a sum of up to 4 non-zero squares.
There are many such forms for a given n usually:
4 = 22 = 12 + 12 + 12 + 12
9 = 32 = 12 + 22 + 22
10 = 12 + 32 = 12 + 12 + 22 + 22
12 = 22 + 22 + 22 = 12 + 12 + 12 + 32
...
1, 2 and 3 all have just 1 way of writing then as a sum of up to 4 squares, 4 has 2 ways, ... so the counts start 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2... A002635.
The first number with 3 such representations is
18 = 32 + 32 = 12 + 12 + 42 = 12 + 22 + 22 + 32.
The smallest numbers with 1, 2, 3, 4, 5, 6, ... representations are 4, 18, 34, 50, 66, 82, ...A124978.
The numbers which only have a single representation as a sum of up to 4 squares: 1, 2, 3, 5, 6, 7, 8, 11, 14, 15, 23, ... A006431.

/ You Do The Maths...

  1. Some special sums of squares
    1. What is special about the numbers 14, 29, 50, 77, 110 if we look at them as a sum of squares?
      Find a formula for these numbers.
      14 = 12 + 22 + 32;
      29 = 22 + 32 + 42;
      50 = 32 + 42 + 52;
      They are all the sum of 3 consecutive squares.
      (n-1)2 + n2 + (n+1)2 = 2 + 3 n2 is one formula.
    2. What about the series 30, 54, 86, 126, 174, 230, ...?
      Find a formula and thus prove they must all be even.
      30 = 12 + 22 + 32 + 42;
      54 = 22 + 32 + 42 + 52;
      86 = 32 + 42 + 52 + 62;
      They are the sums of four consecutive squares.
      (n-1)2 + n2 + (n+1)2 + (n+2)2 = 4 n2 + 4 n + 6 = 2(2 n2 + 2 n + 3) which is always even.
    3. There is an interesting surprise if you find a recurrence relation for each of the above, that is find a formula relating each number in a series to the three before it.
      (optional) Can you generalise your result and prove it?

      They all have the same recurrence relation:
      if a,b,c and d are four consecutive numbers in any one of these series then d = 3 c - 3 b + a.

      It applies to the sum of K consecutive squares for all K.
      To prove this, find the formula for the sum of the K squares starting at n, let's call this S(n).
      Then show that S(n) = 3 S(n-1) - 3S (n-2) + S(n-3).
      We have not used the value of K anywhere in the proof so the recurrence relation applies no matter value K has.

  2. Numbers needing four squares
    1. 1 = 12; 2 = 12 + 12; 3 = 12 + 12 + 12; 4 = 22; 5 = 12 + 22; 6 = 12 + 12 + 22
      but we cannot write 7 as a sum of three or fewer squares - we need 4: 7=12+12+12+22).
      15 is the next number not a sum of up to three squares.
      Looking at the numbers up to 100, how does the series continue?
      7, 15, 23, 28, 31, 39, 47, 55, 60, 63, 71, 79, 87, 92, 95
      Since we know that all numbers are the sum of up to 4 squares then this series is all those numbers that need four squares.
    2. (Harder) Can you find the pattern/formula in the series? (Both Gauss and Legendre found the answer and proved it.)
      Look at the remainders when the odd numbers are divided by 8.
      There is a related pattern the evens in the list.
      The numbers have a remainder of 7 when divided by 8 or are 4 times a number in the list.
      As a formula the set is all numbers 4m(8n + 7) where m and n are positive whole numbers or zero.
      See A004125
  3. Numbers with are a sum of four squares in just one way
    1. Since every number is a sum of up to 4 non-zero squares, let's have a look at those with only one such sum:
      1 = 12; 2 = 12 + 12; 3 = 12 + 12 + 12
      However 4 has two representations: 4 = 22 = 12 + 12 + 12 + 12.
      The next with more than 1 sum of up to 4 squares are 9 and 10 but then 11 can has just one such form.
      So our list of those numbers with just one way to write them as a sum of up to 4 squares begins 1, 2, 3, 5, 6, 7, 8, 11.
      How does it continue if we don't go beyond 100?
      1, 2, 3, 5, 6, 7, 8, 11, 14, 15, 23, 24, 32, 56, 96, (128), ... A006431
    2. (Harder) Which are the only odd numbers in this list?
      Find three separate patterns that cover all the evens.
      The evens are all powers of 4 times another factor. What are those factors?
      The only odd numbers are 1, 3, 5, 7, 11, 15 and 23.
      The evens are 2 or 6 or 14 or a power of four times one of these.
  4. In our sums of squares we have allowed any square to be repeated.
    If we insist that each square in a sum appears only once, or in other words, that all the squares are distinct in any sum then 2 and 3 are impossible as a sum of unique squares as are 6, 7, 8, 11, 12 and 15, ... .
    It might surprise you to know that this list is finite.
    This means we can always write every number beyond a certain limit as a sum of distinct squares.
    What is this limit, the largest number in the list?
    128.
    See A001422 for the complete list of the 31 numbers and a reference to a proof.
  5. Sums of consecutive squares
    1. Find a formula for the sum of the n squares starting at 1.
    2. If your formula was a product of terms in n, write it as a polynomial in n.
    3. Why must the coefficients of the polynomial add to 1? Why is there no constant coefficient in the polynomial?
    4. Use your answers to find the sum of the squares a2 up to b2 inclusive.
      Expand your answer if necessary so that it only has terms of the form ap or bq.
    1. 12 + 22 + ... + n2 = n (n + 1) ( 2n + 1 )
      6
    2. 12 + 22 + ... + n2 = n + n2 + n3
      623
    3. If n=1 the sum is 12 and the polynomial reduces to the sum of the coefficients which must therefore be 1.
      If n=0 the sum is 0 and the polynomial is reduced to just its constant term which must therefore be 0.
    4. a2 + ... + b2 = b + b2 + b3 a + a2a3
      623623
  6. Which numbers are not the sum of the squares of a set of 5 numbers? Note that a set means no number is repeated in a set and sets can have just a single number.
    In 1948 Sprague published a proof that there are only 31 such numbers:
    2, 3, 6, 7, 8, 11, 12, 15, 18, 19, 22, 23, 24, 27, 28, 31, 32, 33, 43, 44, 47, 48, 60, 67, 72, 76, 92, 96, 108, 112, 128
    See A001422
  7. A jigsaw with square pieces
    (n + 1)2 = n2 + 2n + 1 so we can fill a square of side n+1 with one square of side n and (2n + 1) squares of side 1.
    Show this in a diagram.
    We expand on this in the next section.
  8. Towards a proof of the Four Squares theorem?
    If we wanted to prove that every whole number is the sum of four squares (where 0 as a square is allowed), then we could first prove Euler's Identity of 1749:
    (a2 + b2 + c2 + d2) (A2 + B2 + C2 + D2)
    =   (aA + bB + cC + dD)2 + (aB − bA + cD − dC)2 + (aC − bD − cA + dB)2 + (aD + bC − cB − dA)2
    Verify this identity.
    How might it help in a proof that every integer is a sum of four squares?
    See the Number Theory reference by Shanks below for more on this on pages 209, exercises 31S and 32S.

Rectangles dissected into square pieces

n
... 1
Geometry and jigsaw puzzles provide an illustration of algebraic identities.
For instance, in terms of sums of squares we have
(n + 1)2 = n2 + 12 + ... + 12
but the diagram shows that the whole square has sides (n+1) and therefore area (n+1)2 but is made up of
  • a square of side n
  • n squares of side 1 on its right side
  • n squares of side 1 underneath
  • with one more square of side 1 in the bottom right
So (n + 1)2 = n2 + 2n + 1
As a list of squares for (n+1)2 we have n once and 1 repeated 2n+1 times.

Rectangles as sums of Squares - Continued Fractions

45x16 as a CF On the Introduction to Continued Fractions page we showed how to turn any fraction p/q into a rectangle with sides p and q split into squares. Here is the diagram for 16/45. We can always arrange the squares in such diagrams to have one edge along the outside of the rectangle.
So we have seen that ALL rectangles can be split into squares since all fractions have a Continued Fraction form.
Fibonacci spiral squares But the fractions are in their lowest forms so the Continued Fraction diagram method would be of no use for a square because the ratio of its sides is just 1.
The closest we get to rectangle split into distinct squares is a Fibonacci rectangle of sides F(n) and F(n+1) where F(n) is the n-th Fibonacci number but then each has a repeated unit square!
The diagram on the right shows a 21x13 rectangle split into squares with sides 13,8,5,3,2,1 and 1.

Rectangles as sums of distinct Squares

In Martin Gardner's More Mathematical Puzzles and Diversions chapter 17 on Squaring the Squre, contributed by William T Tutte, is all about the hunt for a square or rectangle which can be dissected into different squares - called a perfect rectangle. The search led to using electrical network ideas to find such rectangles. The smallest number of distinct squares we can use is 9 and there are two rectangles with different arrangements if we forget about their reflections and rotations. One has an area of 1056 and the other 4209. There are six with 10 squares and 22 with 11. The series and more information can be found in OEIS on A002839 where it is known up to rectangles with 24 squares.
x
By
A
9978
2157
7743
1641
349
25

Here is a rough sketch of how a rectangle might be divided into squares.
We start by labelling two squares x and y, the length of their sides.
We can then deduce that the top of side A is x + y and, since all pieces are supposed to be squares, so is its height.
Therefore square B is a square of side (side of A) + y = x + 2y.
Continue in this way to deduce the expressions for the sides of each square piece and thus of the whole.
You will end up finding two expressions involving x and y for the same side. Check that it is 9 x = 16 y.
Now we can let y = 9 and x = 16 to keep all sides as whole numbers to find a simple solution for the jigsaw.
If we put these numbers back into the diagram we have the almost-square rectangle 176 by177 shown here.
Is there a square that can be dissected into different squares? Yes, but the smallest seems to have 38 squares in it. TheYou Do The Maths... below look at rectangles with squares-only dissections.

/ You Do The Maths...

  1. (Easy) 165 = 62 + 62 + 52 + 52 + 42 + 42 + 32 + 12 + 12.
    These nine squares can be made into a rectangular jigsaw. The area of the rectangle is 165.
    Cut out the nine squares and and solve the jigsaw puzzle. What are the dimensions of the rectangle?
  2. A rectangular jigsaw puzzle has exactly nine square pieces, each of a different size, and an area of 1056. If the square pieces have sides 1, 4, 7, 8, 9, 10, 14, 15 and 18, what is the width and height of the rectangle and how do the nine pieces fit into it?
    According to Beiler's Recreations in the Theory of Numbers (see Link and References below) this is the smallest rectangular jigsaw where all the pieces are square and of different sizes.
    Check your answer at Doug Williams' Australian Mathematics Task Centre solution
    or on this NRICH page.

How many ways can N be a sum of k squares?

There are some interesting formulas for the number of ways a number N can be written as a sum of k non-zero squares. It is often denoted rk(N).

Sums of two squares

If the sum of two squares is a square, then the three numbers form the sides of the right angled triangles we have looked at earlier on this page. So now we ask which numbers, square or not, are the sum of two squares?
Fermat stated that any prime greater than 2 is the sum of two squares if and only if it has remainder of 1 when divided by 4 or, using the mod function, if and only iff a prime is congruent to (≡) 1 (mod 4). We also have 2 = 12 + 12.
The theorem was proved by Euler in 1749
The primes above 2 are all odd so their remainders when divided by 4 must be either 1 or 3.
primes = a2 + b2
prime3571113171923293137414347
mod 413113311313311
a-1--21--2-14--
b-2--34--5-65--
We can use the identity:
(a + b)2 × (A + B)2 = (aA − bB)2 + (aB + bA)2
= (aA + bB)2 + (aB − bA)2
to show that there is a sum-of-two-squares form for all composite numbers whose prime factors are congruent to 1 mod 4 or, if congruent to 3 mod 4 then have a prime exponent that is even (it is a square).
These numbers are 2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, ... A000404.
If we allow 0 as one of the squares, or, what is the same thing, if we want numbers that are the sum of up to two squares, then we can include 1 itself and 4 and 16, ....
These numbers are 1, 2, 4, 5, 8, 9, 10, 13, 16, 17, 18, 20, 25, 26, 29, 32, ... A001481.

Sums of 3 squares

3, 6, 9, 11, 12, 14, 17, 18, 19, 21, 22, 24, 26, 27, 29, 30, 33, ... A000408 can all be written as a2 + b2 + c2 where a,b and c are not zero.

Sums of 4 squares

There are still some numbers that are neither squares themselves nor can be written as a sum of two or three non-zero squares:
7, 15, 23, 28, 31, 39, 47,... A004215
These need four squares and have the form 4A(8B+7) so they all are either congruent to 7 mod 8 or have a factor which is a power of 4 or both.
All numbers can be written as a sum of up to four squares!

Links and References


Valid HTML 4.01! © 1996-2021 Dr Ron Knott ronknott at mac dot com    Dr Knott's Maths Fibonacci and HOME page