Math question Pythagorean squares

It so happens that 33² + 56² = 65². But 16² + 63² also = 65². Thus (33² + 56²) = (16² + 63²). My question is, is there any deeper reason for why they’re equal other than “because they happen to be”? Or is there some algebraic relationship that would make it obvious why they’re equal?

See

The sum-of-squares function is pretty well understood.

In your case, since 65^2 = 5513*13 does not have any factors of the form 4k + 3, one would expect it to have lots of decompositions into two squares.

Sure. How deep do you want to go? I wrote up quite a bit about the mathematics of sums of squares in this post previously.

But if you just want to understand this particular case, you can just read this post:

What’s going on here is that the complex number A = 3 + 4i has the property that its norm is 5^2 (i.e., 3^2 + 4^2 = 5^2).

[What’s a “norm”, you ask? To any complex number x + yi, we can associate also its conjugate x - yi, and their product, (x + yi)(x - yi) = x^2 + y^2. Call this product the “norm” of our original complex number x + yi (it’s often thought of as |x + yi|^2, the squared magnitude of x + yi, but in this particular context, I want to think of the norm of a complex number as fundamental and the unsquared magnitude as irrelevant, so I’ll stick to the “norm” terminology).]

Symmetrically, this also tells us that the values 3 - 4i, -3 + 4i, -3 - 4i, 3 + 4i, 3 - 4i, -3 + 4i, and -3 - 4i all have that same norm as for A; in general, we can negate one or the other of the components of a complex number, or swap the real and imaginary components, to get 8 values with the same norm (the original value times each of 1, i, -1, and -i, as well as the conjugates of these).

We also have the complex number B = 5 + 12i with norm 13^2. Again, by symmetry, we have not only B, but also iB, -B, -iB, conj(B), i * conj(B), -conj(B), and -i * conj(B) with that same norm.

Multiplying together all 4 variants of A with all 4 variants of B gives us 16 values: 8 of these correspond to A * B under one of our 8 symmetries, while the other 8 correspond to A * conj(B).

And, indeed, what do we get if we carry out these multiplications? A * B = (3 + 4i) * (5 + 12i) = -33 + 56i, which tells us 33^2 + 56^2 = 5^2 * 13^2 = (5 * 13)^2

This must be the same norm as we get for A * conj(B) = (3 + 4i) * (5 - 12i) = 63 - 16i; thus, 16^2 + 63^2 = (5 * 13)^2 as well.

This is why 33^2 + 56^2 = 16^2 + 63^2; the former corresponds to A * B, the latter corresponds to A * conj(B), and these must have the same magnitude.

Finally, you might ask, why was it that the norm of A was indeed a perfect square (5^2), and similarly for B (13^2), so that A * B and A* conj(B) therefore as well produced a norm which is a perfect square (65^2)?

Well, this is because A is in fact (2 + i)^2; since it is a square, so is its norm. Similarly, B is in fact (3 + 2i)^2, explaining why its norm is also a perfect square.

Whoops, forgot to catch this in editing. Change the word “magnitude” here to “norm”; I have no use for the word “magnitude” in this thread.

There are hundreds, maybe thousands, of proofs for this using all sorts of mathematics. However, the Pythagorean proof is probably the easiest to understand.

I don’t think Lumpy is asking why the Pythagorean theorem is true. Lumpy isn’t asking about geometry at all. They are asking about the arithmetic observation that 33² + 56² = 65² = 16² + 63²; whether this is just a random numerical coincidence that these whole number calculations match up this way, or whether there is anything deeper to it.

Whoops, this should’ve said:

Multiplying together all 8 variants of A with all 8 variants of B gives us up to 64 values; actually, it gives us 16 values, each repeated 4 times (corresponding to the fact that factors of 1, i, -1, or -i on the A side could each be cancelled out by corresponding factors of 1, -i, -1, or i on the B side). Those 16 values, in turn can be broken into two groups: 8 of them are variants of A * B under one of our 8 symmetries, while the other 8 are variants of A * conj(B).

Okay, let me try this again then. Lumpy, if you want deeper meaning aside from actual proofs, you’re going about this the wrong way. While algebraic proofs exist, they’re simply another route to derive the same conclusion as a proof based on area or some other means. What you’re going to want to look at here is the philosophy of mathematics. This is a theorem and, by definition, theorems are logical consequences which ultimately follow from axioms. Axioms are usually considered self-evident logical truths which hold across the objective universe and facilitate mathematics. You can consult modern treatments of Euclidean axioms for this.

Geez, I don’t think I even read anything on this page but the word Pythagorean. I definitely need to go to bed and refrain from posting when I’m falling asleep.

Also 65^2 = 60^2 + 25^2 = 39^2 + 52^2. These all come about in the same way. A bit of simple algebra shows that (a^2 + b^2)(c^2 + d^2) = (ab + cd)^2 + (ad - bc)^2.

Now 65^2 = (8^2 + 1^2)(7^2 + 4^2) = (56 + 4)^2 + (32 - 7)^2 = 60^2 + 25^2 and my second one above comes from similarly expanding (8^2 + 1^2)(4^2 + 7^2) in the same way. The two in the OP result from expanding (7^2 + 4^2)(4^2 + 7^2) = 56^2 + 33^2 and (8^2 + 1^2)(1^2 + 8^2) =16^2 + 33^2. There are a lot more combinations (including 65^2 = 65^2 + 0^2) but these either lead to duplications or trivia.

Incidentally, the two ways of getting 65 as a sum of two squares result from the same considerations applied to 5*13.

Er, you must mean (ac + bd)^2 + (ad - bc)^2 on the right-hand side here. [Or, just as well, (ac - bd)^2 + (ad + bc)^2, but the former is closer to what you’ve written]

In terms of complex number norms, we can view this identity as being because a^2 + b^2 is the norm of a + bi, similarly c^2 + d^2 is the norm of d + ci, and (a + bi)(d+ ci) = (ad - bc) + (ac + bd)i, whose norm is the right-hand side above.

All true; as before, the two ways of combining 1^2 + 8^2 with 4^2 + 7^2 can be thought of as the two ways of multiplying complex numbers together (either directly or with one conjugated), either way resulting in the norms multiplying together as well.

But we might wonder why it is that we have 1^2 + 8^2 = 4^2 + 7^2 in the first place, and here again we return to our breakdown from earlier: 4 + 7i = (2 + i)(3 + 2i), while (2 - i)(3 + 2i) = 8 + i. (Recall that 2 + i [corresponding to 1^2 + 2^2 = 5] and 3 + 2i [corresponding to 2^2 + 3^2 = 13] were the basic building blocks observed at the end of my previous post on complex factorization of 65^2)


In recap/summary:

Setting X = 2 + i and Y = 3 + 2i, we have that 5 = X * conj(X), 13 = Y * conj(Y), and therefore (5 * 13)^2 = X^2 * conj(X)^2 * Y^2 * conj(Y)^2. Any way of pulling these factors apart into two groups which are mirror images under conjugation gives us a decomposition of 65^2 as a sum of two squares. In fact, there are 5 such ways to pull this product apart, and thus we find the following 5 ways to express 65^2 as a sum of two squares, up to natural symmetries:

[ul]
[li] X^2 * Y^2 times its conjugate [this corresponds to 33^2 + 56^2][/li][li] X^2 * conj(Y)^2 times its conjugate [this corresponds to 16^2 + 63^2][/li][li] X^2 * Y * conj(Y) times its conjugate [this corresponds to 39^2 + 52^2 = 13^2 * (3^2 + 4^2)][/li][li] X * conj(X) * Y^2 times its conjugate [this corresponds to 25^2 + 60^2 = 5^2 * (5^2 + 12^2)][/li][li]And finally, X * conj(X) * Y * conj(Y) times its conjugate (which is itself) [this corresponds to the degenerate decomposition 0^2 + 65^2][/li][/ul]

[As it happens, these are the only ways to write 65^2 as a sum of two squares, though the above simple algebra does not demonstrate this exhaustiveness. To see this exhaustiveness, we need to understand the uniqueness of prime factorization (in a suitable sense) for complex numbers with whole number components; again, this was spelt out in this previous post, in case you are interested.]

Sorry I erred but the examples make it clear. And while you can use the norm of complex numbers to understand where the formula might have come from (although historically, it didn’t), you don’t need it to prove it.

A more complicated version of it (using quaternionic norm) is used in the proof that every positive number is the sum of four squares.

Complex numbers and quaternions are a bit above my education level. OldGuy got it, although that site is rather poorly worded. Boiled down to its essence: any number that can be factored into primes of the type 4N+1 will have as many different square sums as it has those primes as factors.

Thanks all!

Oh, no worries. Didn’t mean to sound like I was unhappy with your post!

Right! I mention the complex numbers only because I think they make the formulas seem less like random magic, and deepen one’s understanding thereof; it does always amaze me that people historically first discovered these constructions just by thinking about polynomials qua polynomials, and only later realized the interpretation in terms of complex arithmetic.

Yup! A very nice proof along the same lines, though complicated a bit by the non-commutativity of quaternions.

Oh, alas. But this thread is for education, no? Complex numbers are just like ordinary numbers, except we introduce a value that squares to -1. Otherwise, their arithmetic acts just like ordinary arithmetic. They turn out to be extraordinarily useful for understanding many arithmetic phenomena having to do with squaring.

Even if you don’t care about complex numbers, as Hari Seldon noted, you can still see how the relevant combining operations work just with ordinary algebra.

Well, this isn’t quite right. Rather, if all the factors are distinct primes of the type 4N + 1, then the number of square sums will be 1/2 * 2^(# of prime factors) [the 1/2 here is to account for the two orders in which a sum might be written].

More generally, if some of these factors are repeated multiple times, then the number of square sums will be 1/2 * (a + 1) * (b + 1) * (c + 1) * … [rounded up if need be], where a, b, c, …, are the exponents of the various 4N + 1 prime factors. Thus, since 65 = 5^2 * 13^2, we have exponents 2 and 2, so our formula gives us 1/2 * (2 + 1) * (2 + 1) = 4.5, which rounds up to 5. [The 5 ways to write 65 as a sum of two squares noted at the end of this post; we get 4.5 instead of 5 on the dot because the degenerate solution 0^2 + 65^2 ends up counted only with half strength by this formula]

Even more generally, the above formula is correct even when there are other prime factors, so long as every prime factor of the form 4N + 3 has an even exponent, but we still limit the calculation to using only the exponents from prime factors of the form 4N + 1. (If there is a prime factor of the form 4N + 3 with an odd exponent, on the other hand, there will be no way to write the value as a sum of two squares)

All of this is true, but… even better than memorizing the fact that it is true is understanding why it’s true. That’s what I’ve been hoping to convey. That’s the real gold; otherwise, this is just trivia accepted on someone else’s say-so.

Let’s see if I’m following along so far.

The next numbers which fit the criteria the OP mentioned are these triples:
13-84-85
36-77-85

85 is 5*17, which are each square-rooted norms of other complex numbers:
A = 3 + 4i
B = 8 + 15i

And then:
AB = -36 + 77i
A
conj(B) = 84 - 13i

And taking another step back:
X = 2 + i
Y = 4 + i

Xconj(X) = 5
Y
conj(Y) = 17
XX = 3 + 4i
Y
Y = 15 + 8i
conj(Y)*conj(Y) = 15 - 8i

And so:
XXconj(Y)conj(Y) (times conjugate) = (77 + 36i)(75 - 36i)
X
conj(X)YY (times conjugate) = (75 + 40i)(75 - 40i)
XXYconj(Y) (times conjugate) = (51 + 68i)(51 - 68i)
X
XYY (times conjugate) = (13 + 84i)(13 - 84i)

Right?

Does this imply that there can be at most 2 primitive Pythagorean triples with the same hypotenuse? It looks like the primitive forms are always XXYY or XX*conj(Y)*conj(Y), while the others are non-primitive. But maybe that doesn’t follow.

Upon a bit of research, it appears that you can have more than two primitive triples with the same hypotenuse–but that it’s always a power of two (32045 has 8 triples associated with it). I’m going to make a guess that the argument presented so far can be implemented recursively, where if a number can be found whose norm is the hypotenuse of a triple, then you can use the conjugation trick to find another set that will double the number of effective combinations. Or something along those lines…

Yes, that is correct (about the number of primitive triples with a particular hypotenuse always being a power of 2, if there are any).

The deeper story (and, again, this post contains some more details of this argument) is this:

Let’s say two values are “similar” if they each divide the other. Let’s say a value is “prime” if there’s no way to express it as a product all of whose factors are dissimilar from it.

You can keep breaking apart any nonzero value into smaller and smaller factors until eventually you’ve expressed it as a product of primes. An amazing (and not at all obvious, though people often mistakenly assume it is; we can go over the argument for it in more detail if you like) fact is that this factorization is unique (up to re-ordering and similarity).

The above is all true in the familiar context of integer arithmetic, but it’s just as true in the context of complex numbers with whole number components (what are standardly called “Gaussian integers”). [Note: integers are similar if their ratio is either 1 or -1 (the integers whose reciprocals are also integers), while Gaussian integers are similar if their ratio is either 1, i, -1, or -i (the Gaussian integers whose reciprocals are also Gaussian integers)].

However, moving from integers to Gaussian integers changes what the primes actually are. For example, in the integers, 5 is prime; it has no nontrivial factorizations. In the Gaussian integers, however, as we saw, 5 = (1 +2i)(1 - 2i), so 5 is no longer prime. However, it turns out 1 + 2i and 1 - 2i are both prime.

To get the prime factorization of an ordinary integer within the context of the Gaussian integers, we can first take its ordinary prime factorization, and then, for each of those ordinary primes, take their Gaussian prime factorization.

For an ordinary prime, there are three possibilities for its Gaussian prime factorization:

A) It may itself be a Gaussian prime. This happens whenever it is of the form 4n - 1 (proof in other post)
B) It may split apart into two dissimilar conjugate Gaussian prime factors [as with 5 = (1 + 2i)(1 - 2i)]. This happens whenever it is of the form 4n + 1 (proof in other post)
C) It may split apart into two similar conjugate Gaussian prime factors. This happens for just the one remaining ordinary prime, 2, which is equal to (1 + i)(1 - i), those factors being similar to each other via a ratio of i.

So any ordinary integer V has, up to similarity, a Gaussian prime factorization with those three kinds of ingredients: the ordinary primes of the form 4n - 1 from V, along with dissimilar conjugate pairs whose products are the ordinary primes of the form 4n + 1 from V, along with an even number of (1 + i)s, which bundle in pairs to produce the factors of 2 in V.

Expressing V as a sum of two squares means finding a way of pulling apart these factors into two groups which are mirror images under conjugation.

For the primes p of type 4n -1 in V, this means there better be an even number of copies of p in V, and then we have no choice how to do the pulling apart; just identical half and halfs.

For the primes p of type 4n + 1 in V, if p appears in V a total of e many times, then we get e copies of one Gaussian prime G and e copies of its dissimilar conjugate G’ in the Gaussian prime factorization of V, such that G * G’ = p. Pulling this apart means choosing anywhere from 0 to e copies of G, and then taking enough remaining copies of G’ to make e factors total on one side, leaving the conjugates of these for the other side. [I’ve worded this in a messy way, but perhaps you see what I mean? If not, I can clarify with an example]. This means there are e + 1 choices of how to do the pulling apart.

Finally, for the factors of 2 in V, these automatically induce an even number of (1 + i) or (1 - i) factors, all essentially the same (since they’re “similar”), so there’s no choice or problem in splitting them half and half.

From here, we get the formula noted above for the number of ways to express V as a sum of two squares: it has to be the case that each 4n - 1 type prime in V appears an even number of times, and then the number of ways to write V as a sum of two squares is the product of (e + 1) over each exponent e of a 4n + 1 type prime in V. We can multiply this by 1/2 again to get rid of the double counting from swapping order (i.e., to not count a^2 + b^2 as different from b^2 + a^2); once we do that, the double counting coming from negations is also automatically taken care of, as part of our treatment of “similarity”. [The one nitpick is that this will count 0^2 + x^2 or x^2 + x^2 sums as only half of a possibility, because the corresponding Gaussian integers are similar to their conjugates and so we’ve over-compensated for double counting them, but that’s ok; at most one of these will come up (the former if V is a perfect square, the latter if V is twice a perfect square), so we can just round up at the end]

Alright, that’s the formula to count arbitrary sums of two squares which equal V. But suppose we want only primitive cases; that is, x^2 + y^2 = V where no ordinary integer divides both x and y.

These arise from complex numbers x + yi which aren’t divisible by any ordinary integer.

This means no ordinary prime factors can come up (so V mustn’t have any prime factors of the form 4n - 1). It also means, when we do the pulling apart, we can’t have any Gaussian prime and its conjugate on the same side (or else their product would be an ordinary integer dividing the result). So for prime factors of the form 4n + 1 in V, we no longer have free reign to choose anywhere from 0 to e copies of G and fill in the rest with G’ as before; it’s either all G or all G’, just those 2 choices. Finally, for copies of 2 in V, if there’s just one, we’re ok; we split (1 + i) * (1 + i) halfway and end up with just a (1 + i). But if there are any more copies of 2 in V, we get at least 2 copies of (1 + i) in each half of our splitting, which makes each half divisible by 2, and thus non-primitive.

This gives us our formula for the number of ways to write V as a primitive sum of two squares: it is zero if V has any prime factor of the form 4n - 1, or if V has more than one factor of 2. Otherwise, it’s 2 raised to the number of prime factors of the form 4n + 1 in V [and then, as before, we divide this result by 2 if we don’t care about order].

This is why the number of primitive triples with a particular hypotenuse is always a power of 2. For example, 32045 is 5 x 13 x 17 x 29. All of those factors are of the form 4n + 1, so it’s possible to express 32045 as the norm of a “primitive” Gaussian integer. There will be 2 choices to choose from for each of those factors (i.e., do we pull 1 + 2i or 1 - 2i from the 5; do we pull 2 + 3i or 2 - 3i from the 13; etc.). This yields a total of 2^4 many ways to write 32045 as a sum of two squares. Dividing by 2 to account for swapping order, we’re left with 2^3 = 8 many ways, as you noted.

Phew! There are almost certainly things in the above which could be worded better, mistakes I haven’t caught, etc., but I’ll leave it at that for now. Feel free to ask for clarification on anything.

Good observation! If a form has an X * Conj(X) or a Y * Conj(Y) in there, it’s non-primitive, since those already come out to ordinary integers. In the other cases you looked at, you get primitivity, since there are no ordinary integer factors produced in the complex number being built up.

But the reasoning that led you to see there were 2 primitive Pythagorean triples with the same hypotenuse (i.e., two ways to write H^2 as A^2 + B^2 with A and B coprime) was based there being an X, a different conj(X), a different Y, a different conj(Y), and nothing else in the Gaussian prime factorization of H.

This works if H has two distinct primes in its ordinary factorization, both of the form 4n + 1. So it worked for H = 5 * 17. In general, however, things depend on how many copies of different primes of different sorts there are in H, as outlined in the previous post.