Complex Extensions, Two Cubes and a Square

x3 + y3 = zn

When exponents are odd, the sign of the variable matters. Are we adding two cubes, or subtracting two cubes, to get an nth power?

In the pages that came before, x and y were raised to even powers, and we were a bit cavalier about the signs. "If x comes out negative, just make it positive."

We could have been more rigorous. There is always a characterization where the signs on x and y come out right. But sometimes we set these aside for the convenience of making u and v positive, or in some cases, u > v > 0. With u and v in the first quadrant, we knew that distinct pairs could not be associates, and would thus produce different triples. The characterization was simple and complete, as long as you don't mind negating x and y as necessary.

With cubes, we don't have that luxury, and we're going to have to be a bit more careful. The parameters u and v could cover the entire plane, and we need to consider the possibility that different [u,v] pairs could be associates, and could lead to the same triple.

The expression x3+y3 factors nicely in Z[q], where q is the cube root of 1. Start at 1 in the unit circle in the complex plane and move around counterclockwise 120 degrees. You have reached (-1+sqrt(3)i)/2, which is the cube root of 1. I'm calling this q. It's square, 240 degrees around, is also a cube root of 1, and its cube is of course 1. Verify all this using Demoivre's Formula.

When q is the cube root of 1, as described above, q+1 is the sixth root of 1. The ring is therefore the integers adjoin the sixth roots of 1. We already showed this ring is a ufd.

Factor the equation as follows.

(x+y) × (x+yq) × (x+yq2) = zn

Start by assuming x y and z are coprime integers.

Suppose a (possibly complex) prime p divides x+y and x+yq. It then divides the difference (1-q)y. If the other factors are involved, y could be multiplied by q-q2 or q2-1, but these are all associates of 1-q, namely 1-q times some power of q, so don't worry about that. If p divides y it also divides x. This can cause trouble if p is a real prime, or one of its associates. This because x and y are coprime, and should not have a common factor of p. Even if p is a complex prime, p conjugate also divides y, and x, and the integer p times p conjugate divides y and x, and we have a contradiction. The common prime p shared by any two factors on the left cannot divide y, hence it is an associate of 1-q.

Is 1-q a prime? Its norm is the square of its distance from the origin, which is 3/2 squared plus sqrt(3)/2 squared, or 9/4 + 3/4, or 3. Thus 1-q is the prime lying over 3. Its conjugate 1-q2 is the "other" prime lying over 3, though in this case the two primes are associates, i.e. the same prime.

Our characterizations will depend on whether 3 divides z or not. We saw this earlier. There were some triples such as x2+3y2 = z2, whose characterizations looked quite different when z was even or odd.

Let p be a complex prime, other than 1-q, dividing z. It divides one of the three factors on the left, and all instances of p divide this factor. Since the right side is an nth power, pn divides into this factor. In other words, each of the three factors is an nth power.

The real factor x+y is special, for p conjugate also divides x+y. Together, p and its conjugate build a prime integer whose nth power goes into x+y. Of course there is no reason to bring in the conjugate if p already equals its conjugate, i.e. p is a real number, or if p is an associate of its conjugate.

It is not surprising that x+y is an nth power; this is the xyn lemma. If 3 divides z, that theorem tells us x+y is an nth power divided by 3. In other words, x+y soaks up all the factors of 3 except for one. This one is split between x+yq and x+yq2. Neither can be divisible by 3, else x and y are divisible by 3, so let 1-q divide x+yq and let 1-q2 divide x+yq2. Since 1-q and 1-q2 are associates, it doesn't matter which prime goes with which factor, so go ahead and make the above assignment. It's convenient. Again, this is only necessary when 3 divides z.

With z and 3 coprime, x+yq is an associate of (u+vq)n. Expand this by the binomial theorem. Separate the sum into three parts. Let a be the sum of every third term, starting with un. Let b be the sum of every third term beginning with nvun-1. Finally, let c be the sum of every third term beginning with (n:2)v2un-2. Notice that a collects the real terms, with q3, q6, q9, etc. And of course, q3 = 1. These all map to x. The terms of b map to y, and c is subtraacted from x and y. This because q2 is equal to -1-q. Therefore x = a-c and y = b-c.

Remember that x+yq is an associate of this expression. We might need to multiply by -1, whence x = c-a and y = c-b. Beyond this, we might multiply by q or q2. This cycles a b and c. In other words, multiplication by q applies a to y, rather than x, because the terms that use to be real now have a factor of q. Here are the possibilities.

±x ← a-c, ±y ← b-c
±x ← c-b, ±y ← a-b
±x ← b-a, ±y ← c-a

If 3 divides z, multiply by 1-q. The value of a still contributes to x, but it also subtracts from y, thanks to -q. Here are the possibilities.

±x ← a+b-2c, ±y ← 2b-c-a
±x ← c+a-2b, ±y ← 2a-b-c
±x ← b+c-2a, ±y ← 2c-a-b

If u and v have a prime in common, then a b and c have a prime in common, and x and y have a prime in common. Therefore u and v are coprime.

If one variable is 0 then the other needs to be 1. Thus un or vn is the only nonzero term. One of a b or c is 1. This usually sets x or y to 0, which is no good. Sometimes it sets x and y to 1, yet 2 is not an nth power. Finally it can set x to 1 and y to 2, giving 13 + 23 = 32. This is the only legitimate reason to set v = 0. Otherwise u and v are nonzero.

x3 + y3 = z2

If we need the unit q2 to make (u+vq)2 equal to x+yq, simply fold q into u+vq. In other words, we don't have to worry about the associate q2(u+vq)2. Similarly, q(u+vq)2 goes away, as we could multiply u+vq by q2. We only need check for ±1.

Take the square of u+vq and write a = u2, b = 2uv, and c = v2. Here are the possibilities. The last two occur when 3 divides z.

x ← u2 - v2, y ← 2uv - v2
x ← v2 - u2, y ← v2 - 2uv
x ← u2 + 2uv - 2v2, y ← 4uv - u2 - v2
x ← 2v2 - u2 - 2uv, y ← u2 + v2 - 4uv

There isn't much difference between the first two. We're merely negating x and y, which negates x3 and y3, which negates z2, but z2 has to be positive. Let's just look at the first one, and if the difference in cubes comes out negative, we'll know that's -z2.

If u+v is negative negate both u and v, which doesn't change the solution. If u = ±v then x comes out 0, so u+v > 0.

Remember that x+y is a square. Thus u2+2uv-2v2 is ±g2. Add 3v2 to this to get a square, namely (u+v)2. Since squares cannot sum to 3 times a square, we're talking about +g2, and we have the following.

g2 + 3v2 = (u+v)2

With u and v coprime, v and u+v are coprime. We're looking for coprime triples.

Start by assuming u+v is odd, and use the first characterization of those triples. Remember that v could be negative, so we have to consider v = 2st and v = -2st.

s > 0, t > 0, s and t coprime, s and t of different parity, 3 !| s:
g ← ±(s2 - 3t2)
v ← ±2st
u+v ← s2 + 3t2
u ← s2 + 3t2 - v

x ← s4 - 4s3t + 6s2t2 - 12st3 + 9t4
y ← 4s3t - 12s2t2 + 12st3
z ← s6 - 6s5t + 15s4t2 - 45s2t4 + 54st5 - 27t6
x ← s4 + 4s3t + 6s2t2 + 12st3 + 9t4
y ← - 4s3t - 12s2t2 - 12st3
z ← s6 + 6s5t + 15s4t2 - 45s2t4 - 54st5 - 27t6

Next let u+v be even. This leads to two characterizations of the pythagorean triples, and since v could be plus or minus, we have four more formulas for cubes summing to a square. With the two shown above, there are six in total.

s > 0, t > 0, s and t coprime, s and t of different parity, 3 !| s:
g ← ±(s2 - 3t2 - 6st)
v ← ±(s2 - 3t2 + 2st)
u+v ← 2s2 + 6t2
x ← -8s3t + 24s2t2 - 24st3 + 72t4
y ← s4 - 4s3t + 6s2t2 + 60st3 - 63t4
z ← s6 - 6s5t + 15s4t2 - 180s3t3 + 495s2t4 - 486st5 - 351t6
x ← 8s4 + 8s3t + 24s2t2 + 24st3
y ← -7s4 - 20s3t + 6s2t2 + 12st3 + 9t4
z ← 13s6 - 54s5t - 165s4t2 - 180s3t3 - 45s2t4 - 54st5 - 27t6

g ← ±(s2 - 3t2 + 6st)
v ← ±(s2 - 3t2 - 2st)
u+v ← 2s2 + 6t2
x ← 8s3t + 24s2t2 + 24st3 + 72t4
y ← s4 + 4s3t + 6s2t2 - 60st3 - 63t4
z ← s6 + 6s5t + 15s4t2 + 180s3t3 + 495s2t4 + 486st5 - 351t6
x ← 8s4 - 8s3t + 24s2t2 - 24st3
y ← -7s4 + 20s3t + 6s2t2 - 12st3 + 9t4
z ← 13s6 + 54s5t - 165s4t2 + 180s3t3 - 45s2t4 + 54st5 - 27t6

Set s = 2 and t = 1 and crank out six solutions.

83 - 73 = 132

1053 - 1043 = 1812

653 + 563 = 6712

3363 - 2153 = 52912

2803 - 1113 = 45372

1123 + 573 = 12612

But that's only half the story. Remember that z could be divisible by 3, whence x = u2+2uv-2v2 and y = 4uv-u2-v2. The sum, 6uv-3v2, is 3 times a square. Thus 2uv-v2 is ±g2.

If a prime divides v and 2u-v it divides 2u. It cannot divide u, hence it is 2. The factors are coprime, other than 2. They are both squares, or they are both twice squares.

Negate u and v if need be, so that v is positive. Thus v = t2 and u = (±s2+t2)/2, or similar equations when the factors are twice squares.

s > 0, t > 0, s and t coprime, s and t odd, 3 !| s:
v ← t2
u ← (±s2+t2)/2
x ← (s4 + 6s2t2 - 3t4) / 4
y ← (-s4 + 6s2t2 + 3t4) / 4
z ← (3s5t + 9st5) / 4
x ← (s4 - 6s2t2 - 3t4) / 4
y ← (-s4 - 6s2t2 + 3t4) / 4
z ← (3s5t + 9st5) / 4

The second characterization is the same as the first, with x and y swapped and negated, so we only need retain the first.

If 3 divides s then 3 divides x and y. These are solutions with common primes, and we'll get to that in a minute. For now, 3 does not divide s.

When s = t = 1 we have 13 + 23 = 32.

When s = 5 and t = 1 we have 1933 - 1183 = 23552.

Next let v = 2t2 and let u = ±s2+t2.

s > 0, t > 0, s and t coprime and different parity, 3 !| s:
v ← 2t2
u ← ±s2+t2
x ← s4 + 6s2t2 - 3t4
y ← -s4 + 6s2t2 + 3t4
z ← 6s5t + 18st5

Set s = 2 and t = 1 to get 373 + 113 = 2282.

Finally a few words about solutions that are not coprime. Let g be the gcd of x and y. If p2 divides g then we can divide x and y by p2 and z by p3. Thus g consists of individual primes. Divide through by g and look for coprime solutions to x3+y3 = gz2. If x+yq = (u+vq)2 as before, then x+y has to be g times a square. Or, if some of the primes of g split, they can be tacked onto (u+vq)2, whence they no longer constrain x+y. There are many many possibilities, and I'm not going to go into them here. The characterization of coprime solutions was bad enough!

Just one example: set u = 2 and v = 3. Multiply (u+vq)2 by 1-q to get -2+11q. Since 11-2 is a square, we have x3 + y3 = 3z2. Specifically, 113-23 = 3×212. Multiply x y and z by 3 to get the minimal triple 333 - 63 = 1892.

x3 + y3 = 3z2, coprime terms

A variation on the xyn lemma tells us where the factors of 3 lie. Let's follow it through. With d = x+y we have the following.

d3 - 3d2x + 3dx2 = 3z2

Clearly 3 divides d. Divide through by 3 and verify that dx2 has the lowest power of 3 on the left. This must agree with the power of 3 in z2. In other words, x+y soaks up all the powers of 3 except one, and that one is split between x+yq and x+yq2.

As before, x = u2+2uv-2v2 and y = 4uv-u2-v2. The sum, 6uv-3v2, is a square. The factors v and 2u-v are coprime, except perhaps for 2. They are a square and 3 times a square, or 2 times a square and 6 times a square. If you do all the algebra, half of the cases lead to triples that are entirely divisible by 3. I'm going to leave those on the cuttingroom floor.

s > 0, t > 0, s and t coprime, s and t odd, 3 !| s:
v ← 3t2
u ← (±s2+3t2)/2
x ← (s4 + 18s2t2 - 27t4) / 4
y ← (-s4 + 18s2t2 + 27t4) / 4
z ← (3s5t + 81st5) / 4

s > 0, t > 0, s and t coprime and different parity, 3 !| s:
v ← 6t2
u ← ±s2+3t2
x ← s4 + 18s2t2 - 27t4
y ← - s4 + 18s2t2 + 27t4
z ← 6s5t + 162st5