Home > A Level, Maths, Teaching > Pythagorean Triples

Pythagorean Triples

So, pythagorean triples. For those who don’t know, pythagorean triples are right angled triangles with integer (whole number) side lengths. The most famous pythagorean triple is the 3, 4, 5 triangle.

These triangles are great for maths teachers, as they can be used to make the arithmetic easier when introducing higher mathematical concepts. They are often favoured by exam boards for the same reason. Recently I have been working on the Edexcel M3 module and it seems that EVERY triangle they use is a 3,4,5 or a multiple there of. Noticing this fact has help my students and I save lots of time, we lost 20 minutes to this by not spotting it:


Yesterday we were revising FP1 and one of my students was finding the modulus of -7 + 24i, as she was typing the required sum into her calculator I said “25” to the general amazement of the class. They were intrigued as to how I did it so quickly, I explained I knew that the 7,24,25 triangle was a pythagorean triple and this led onto a fascinating discussion.

They thought it was an impressive trick, and I told them that yes, it was, and another good trick (courtesy of @icecolbeveridge) was knowing that the angles if a 3,4,5 triangle are roughly 53.13 and 36.87 degrees!

We discussed this further, and they asked how many triples I knew “off the top of my head”. I explained that I could write them forever if we weren’t limited to primitive triples, because I could just add 3,4 and 5 to the respective sides. This lead to a nice discussion about primitive triples. Which are those where the side lengths are co-prime (have no common factors). And then I wrote the primitive ones I could remember:


This prompted the question “is it some sort of sequence? I can see the smallest side is the sequence of odd numbers.” I was impressed how quickly they had spotted than, but I then remembered the 8,15,17 triangle which has an even numbered smallest side. I also told them that I have a vague recollection that there is  a way to use one primitive triple to generate another but I can’t remember it. (A quick Google search didn’t help, so perhaps I imagined it. If you know it, I’d love you to tell me!)

I then discussed Euclid’s formula for generating triples and then moved on to my favourite way:

Take two unit fractions with denominators one apart, add them. The answer in its simplest form will be a fraction in which the numerator and the denominator form the short legs of a pythagorean triple.

I’m not sure where I first heard this method, but I do love it and I often use it when working out questions to set my classes. I explained that this method shows there are infinitely many primitive triples, as it will generate infinitely many, but that I didn’t think it would generate them all. (Again, I don’t know if it will or not, I just imagine it won’t. Do send me a link to a proof either way if you have it!)

The class, interested and enthused as ever, wanted to see proof that this always worked. They had tried lots of numbers and they had all worked, but they knew this didn’t prove it. I then said we would prove it together.

I asked how we might start, had the word induction thrown at me, then one said,

“could we start with 1/m + 1/(m+2), then square the top and bottom of the answer and see if it’s a square?

I shouted “excellent” and so we did:


Obviously this isn’t the whiteboard… I forgot to photograph it so have recreated it on paper.

The start, adding the fractions:


Then squaring the numerator and denominator, manipulating the expression and factorising:


And finally, the all important statement:


Do you have a preferred method of generating triples? Or do you know any interesting facts about them? I’d love to hear them.

  1. flyingcoloursmaths
    May 2, 2014 at 7:40 am

    The Ninja says 2t, (t^2-1), and (t^2 + 1), for integer t ≥ 2.

  2. May 2, 2014 at 12:00 pm

    Reblogged this on The Echo Chamber.

  3. Stevie D
    May 2, 2014 at 4:22 pm

    Simple method to generate Pythagorean triples:

    Take any number – this will be the short side.
    Square it – then halve it if you started with an odd number, or quarter it if you started with an even number.
    The integers either side will be the longer sides.

    This works for every integer greater than or equal to 3 to give a unique triple.

    Corollary – any composite number greater than 4 can be the short side of more than one triple (because it can either be on a base triple as described above, or a scaled triple based on one of its factors)

  4. Mark Bennet
    May 2, 2014 at 5:49 pm

    If you have $m$ and $n$ integers with one even and one odd and no common factor you will find that m^2+n^2, m^2-n^2 and 2mn form a primitive pythagorean triple (i.e. the sides have no common factor). Any positive integer triple where the sides have no common factor can be formed in this way. Any positive integer triple is a multiple of one of these basic ones. It is easy to prove that you get a triple this way, a bit harder (and is a good basic mathematical proof) to show that you get every triple this way. This is incidentally related to the fact that if t=tan (x/2) then sin x = (2t)/(1+t^2) and cos x = (1-t^2)/(1+ t^2) – so if t is rational so are sin x and cos x and when you clear denominators in the set (1+t^2), (1-t^2), 2t you get a pythagorean triple. For proof of the m,n version suppose a^2=b^2+c^2 – then b and c can’t both be odd, because then a^2 would be even and not divisible by 4. So since we assume they have no common factor, one is even and the other odd. Suppose c is even=2d, then d^2=a^2-b^2=(a+b)/2 x (a-b)/2. The two factors on the right are coprime – they have sum a, and difference b which are coprime, so they must be squares. Set a+b=2m^2, a-b=2n^2 and you have a=m^2+n^2, b=m^2-n^2 and c=2mn as required. That was a sketch, with plenty to explore.

  5. September 4, 2014 at 11:58 am

    I like the matrices here: http://en.wikipedia.org/wiki/Tree_of_primitive_Pythagorean_triples

    By the way, you have a typo in this line:

    Take two unit fractions with denominators one apart, add them

  1. No trackbacks yet.

Leave a Reply to flyingcoloursmaths Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: