❚

4–6 minutes

reading

·

Generating near-Pythagorean Triples

Introduction

I have two set reactions to any post I see on LinkedIn: I either scoff at it for its awful quality, or I scoff at it to mask my jealousy of someone else’s success. However, earlier today I was doing my usual scoffing (as illustrated below) at another boring arrangement of characters and I realised that the post I was looking at actually had something of interest for once. It spoke of near-Pythagorean triples, that is, the set of integer triples (a,b,c)(a,b,c) that solve the equation a2+b2=c2+1.a^2+b^2=c^2+1. You can see why they’re called “near-Pythagorean”, because they’re not quite of the form a2+b2=c2a^2+b^2=c^2, but they’re near. This is something that interested me because each triple that solves the equation is “primitive”, meaning that gcd(a,b,c)=1\text{gcd}(a,b,c)=1 no matter what.

Rough sketch of me scoffing

Unfortunately, because the post was from LinkedIn I presume the post would’ve been banned if it actually explored anything insightful, so all it really gave was an example of such a triple, and asked if you (the reader) can find one. Given the fact that we can quite easily generate a primitive Pythagorean triple from Euclid’s formula for Pythagorean triples, I wondered if we can do the same but with near-Pythagorean triples. It turns out we can, and today dear reader, you shall learn how.

Parametrising evens and odds

Suppose we want to generate a triple using an even number aa, by writing a=2ka=2k, we can then find b=2k2−1, c=2k2b=2k^2-1,\ c=2k^2.

Proof.Proof. By simple substitution, we see that

a2+b2=(2k)2+(2k2−1)2=4k2+4k4−4k2+1=4k4+1=c2+1;\begin{align*} a^2+b^2&=(2k)^2+(2k^2-1)^2\\ = 4k^2+4k^4-4k^2+1\\ =4k^4+1\\ =c^2+1; \end{align*}

as desired.

To do the same but with an odd number, we only need write a=2k−1a=2k-1 and then find b=k2−k−1, c=k2−k+1b=k^2-k-1,\ c=k^2-k+1.

Proof.Proof. We do the following,

a2−1=(a−1)(a+1)=(2k−2)(2k)=(2k2−2k)(2)=((k2−k+1)+(k2−k−1))((k2−k+1)−(k2−k−1))=(c+b)(c−b)=c2−b2,\begin{align*} a^2-1&=(a-1)(a+1)\\&=(2k-2)(2k)\\&=(2k^2-2k)(2)\\&=\big((k^2-k+1)+(k^2-k-1)\big)\big((k^2-k+1)-(k^2-k-1)\big)\\&=(c+b)(c-b)\\&=c^2-b^2, \end{align*}

which establishes the result.

The Thought Process

If I stopped the article with the proof, then the introduction would be half the article. To prevent this, I might as well tell you how I came about finding the method. It was based in the idea of the aforementioned formula of Euclid, where I asked myself “what if I fixed aa and worked out some numbers from there?” I noticed that for any odd number n=2k−1n=2k-1, you can write n=(k+(k−1))(k−(k−1))n=(k+(k-1))(k-(k-1)) which if you write b=k−1, c=kb=k-1,\ c=k then n=c2−b2n=c^2-b^2 , and so by writing n=a2−1n=a^2-1 for any even aa, we get an odd nn and so can find a desired triple.

But this doesn’t translate so easily for an even nn because the average of 11 and nn is odd, giving non-integer solutions. So I asked myself, what’s a factor that isn’t 11 or nn that divides every possible even nn, the clear answer was two. The problem that remained though was that if nn was not a multiple of four, then the average of two and it’s paired factor would not be an integer. If that’s unclear, here’s an argument that may convince you:

Set n=4k+2n=4k+2 so that it is not a multiple of four but is even, then n=2(2k+1)n=2(2k+1). Note that 2=(2k+32−2k−122=(\frac{2k+3}{2}-\frac{2k-1}{2}) and 2k+1=(2k+32+2k−12)2k+1=(\frac{2k+3}{2}+\frac{2k-1}{2}), and so if we use the exact same logic as last time, then we get

n=(2k+32)2−(2k−12)2.n=\Big(\frac{2k+3}{2}\Big)^2-\Big(\frac{2k-1}{2}\Big)^2.

This does not get us a proper triple because the values in the brackets are not integers, so our “b““b” and “c““c” wouldn’t be whole numbers as desired.

Thankfully, one can observe that every even number one less than an odd square is a multiple of four, so the issue resolves itself. As such, we have our generators. As for whether ALL near-Pythagorean triples are of the forms I proposed, that’s an unanswered question on this website, but I’ll think about it and get back to you. I should add that when I looked up the problem further, it turns out that there’s another type of near-Pythagorean triple which the LinkedIn post did not mention, they’re integer triples (a,b,c)(a,b,c) that solve a2+b2+1=c2a^2+b^2+1=c^2. I’ve since found a generator for when we force aa to be even, and discovered something even more interesting about when we force aa to be odd. Though I could barely get this out given how busy I am right now so be prepared to wait. If you spot any typos let me know because I haven’t been bothered to properly proof-read this. Love you all, xoxo.

Comments

Leave a Reply

❚

Latest posts

★

Professional Tutor

Designed with WordPress