Seeing as I have a great interest in maths, at some point I decided to try and solve Fermat’s last theorem. I obviously didn’t get very far, but I did find some interesting things while attempting to find the solution. One discovery was a way to construct a Pythagorean triple given any natural number (positive whole numbers). This means that, given a positive integer x, you can always construct an equation:

x^{2} + y^{2} = z^{2}

And it also gives you a way to construct this equation. There are 2 different equations, one for even numbers, and one for odd numbers:

if x is odd:

x^{2} + (^{(x2-1)}⁄_{2})^{2} = (^{(x2+1)}⁄_{2})^{2}

for example, 7^{2} + (^{(72-1)}⁄_{2})^{2} = 49 + 576 = 625, which equals (^{(72+1)}⁄_{2})^{2} . This is the equivalent of 7^{2} + 24^{2} = 25^{2}

if x is even:

x^{2} + (^{x2}⁄_{4} – 1)^{2} = (^{x2}⁄_{4} + 1)^{2}

for x=6:

(^{62}⁄_{4} – 1)^{2} + 6^{2} = 64 + 36 = 100, which equals (^{62}⁄_{4} + 1)^{2}. This is the equivalent of 6^{2} + 8^{2} = 10^{2}.

Why does this work? Well, To start, it helps to understand a little bit about the relationship between odd numbers, square numbers, and Pythagorean triples.

Square numbers are numbers that are formed by taking an integer, for example 3, and multiplying them by themselves. 3×3 = 9, so 3 squared is 9. There is a cool mathematical fact, that all square numbers can be made by adding together a consecutive group of odd numbers; more specifically, n^{2} is the sum of the first n odd numbers. For example, 4^{2} is 1+3+5+7, or 16, the first 4 odd numbers. To see why this works, you can represent the square number n^{2} as a geometric square, with a side length of n.

This table has side lengths of 6, and an area of 36 squares. But how does this translate into a square being made up of consecutive odd numbers? Well, if you colour the square like this, it makes more sense:

As you can see, each new layer of the square is in a different colour. If you count them, each differently coloured layer is an odd number. There is one black square, 3 red squares, 5 orange squares, 7 green, 9 blue, and 11 purple. Each of these layers is 2 larger than the previous, making it a new odd number. I’m not going to explain the proof here, but it is a fact that the nth square number is the sum of the first n odd numbers.

But how does this help us make Pythagorean triples? To start with, we will look at the case where x, the number chosen to be part of the Pythagorean triple, is odd. in this case, x^{2} will also be odd. Now, we know that x^{2} will look something like this on the chart (although it can cover more or less squares):

So, we know that it can fit on the chart as a square; but the square is itself an odd number, so it can also be fitted on the chart in one of the layers, since the layers cover all odd numbers starting at one:

This means that your odd square, in this case 9, is both a square, and also the difference between two other squares, in this case 4^{2}, and 5^{2}, because it adds the extra layer around 4^{2} to make it into 5^{2}. In this case, your odd square is also the difference of two other squares, which means that you can write:

5^{2} – 3^{2} = 4^{2}

which can be rewritten as:

3^{2} + 4^{2} = 5^{2}

a Pythagorean triple. However, how do you extend this to the general case?

Well, firstly you take your generic odd square x^{2}. You then need to find which layer of the square it is on; you know that the odd numbers in the layers rise by 2 every time, going 1,3,5,7,9, and so on, so you can figure out that, to get the position, you add one, to account for the whole series starting at 1 instead of 0, and divide it by 2, because it moves up by 2 every layer. this gives you ^{(x2+1)}⁄_{2}. This is the z of the answer, z^{2}. To get y, you simply change the formula to ^{(x2-1)}⁄_{2}, to go one layer back, because the odd number only added one extra layer to get to z. this gives you:

x^{2} + (^{(x2-1)}⁄_{2})^{2} = (^{(x2+1)}⁄_{2})^{2}

The formula from the beginning.

If x is even, the process is very similar, with one caveat; because x is even, it cannot be a layer in the square. It can, however, be two layers added together, because if you take any even number, divide it by two, and add one to one half and subtract one from the other, you get two consecutive odd numbers. This allows you to represent it with two layers. I won’t go through the explanation again, but it gives you this equation:

x^{2} + (^{x2}⁄_{4} – 1)^{2} = (^{x2}⁄_{4} + 1)^{2}

This allows you to generate Pythagorean triples, and also shows that any natural number can generate a triple. A short python program that uses this principle:

def Triple(x): if x%2 != 0: y = (x**2-1)/2 z = (x**2+1)/2 print x, 'squared plus', y, 'squared equals', z, 'squared.' else: y = (x**2/4)-1 z = (x**2/4)+1 print x, 'squared plus', y, 'squared equals', z, 'squared.'

Have fun with this largely pointless piece of information!

## Leave a Reply