Can the Cubes of Two Prime Numbers Sum to a Square?

Please see also: UPDATE 1     UPDATE 2 .

In other words, does the Diophantine equation a3 + b3 = c2 have any solutions with a,b both prime?

Yes, here are two examples: 113 + 373 = 2282 and   86633 + 21373 = 8123402.

In fact there are lots of solutions with a,b both prime. Ed Pegg, on the sequence fans mailing list asked the question:

Is the number, c, which occurs in a solution with a,b prime always divisible by 12?

I gave a fairly complete analysis of this question and emailed it to the list on Saturday, October 23, 2004 5:56 PM.  Subsequently, Dean Hickerson send a proof to the sequence fans list, different from mine in that it did not use parameterizations. For some reason (email problems?) my message never appeared on the list. So I sent it again the next day. Here is that message:


Ed Pegg, based on numerical information from Kirk Bresniker, 
asks whether a,b prime and a^3 + b^3 = c^2 implies that 
c is divisible by 12. Hugo Pfoertner, Ralf Stephan, an 
myself provided additional numerical evidence and comments.
Finally, Paul C. Leopardi proved a lemma that is almost the 
desired result, but unless I misunderstood needed an 
additional hypotheses.  

Here is additional information which amounts to a proof 
and some parameterized solutions, but some details omitted.

Lemma 1:  if gcd(a,b)=1 then gcd(a+b,a^2-a*b+b^2)=1 or 3.

proof:  Since (a+b)^2-(a^2-a*b+b^2) = 3*a*b, any prime p<>3 
which divides both a+b and a^2-a*b+b^2 will divide a or b and
a+b hence it will divide both a and b contrary to gcd(a,b)=1.
Similarly 3^k for k>1 cannt be a common divisor.

Lemma 2:  If gcd(a,b)=1 and a^3 + b^3 = c^2 then either
  (1)  a+b and a^2-a*b+b^2 are both squares or
  (2)  a+b and a^2-a*b+b^2 are both 3 times squares.

proof:  a^3+b^3 = (a+b)*(a^2-a*b+b^2) = c^2 and lemma 1.

Now complete parametric solutions can be given for both 
(1) and (2).  The technique to find these is the standard 
method of finding all rational points on a quadratic curve 
when you know one point, by intersecting with lines of 
rational slope through the point.  To get integers we need 
to write the slope as a quotient of integers and multiply by
appropriate squares to eliminate denominators.  I omit details.

But the results are:

(1) if a+b and a^2-a*b+b^2 are both squares then a parameterized: 
    solution of a^3+b^3=c^2 is:

    a = -4*n*(-2*n+m)*(n^2-m*n+m^2)
    b = (m-n)*(m+n)*(7*n^2-4*m*n+m^2)  
    c = (n^2-4*m*n+m^2)*(13*n^4-14*m*n^3+6*m^2*n^2-2*m^3*n+m^4)

    Note:        a+b = (n^2-4*m*n+m^2)^2 and 
         a^2-a*b+b^2 = (13*n^4-14*m*n^3+6*m^2*n^2-2*m^3*n+m^4)^2

    Note 2:  m and n are integers so certainly a and b cannot be
             prime.  
     
    Note 3:  it is possible in this case for a and b to be relatively 
             prime and c not divisible by 12.

(2) if a+b and a^2-a*b+b^2 are both 3 times squares then a 
    parameterized solution for a^3+b^3=c^2 is:

    a =  3*m^4-n^4+6*m^2*n^2
    b = -3*m^4+n^4+6*m^2*n^2
    c =  6*m*n*(3*m^4+n^4)

    Note:        a+b = 12*m^2*n^2
         a^2-a*b+b^2 = 3*(3*m^4+n^4)^2,
         and each is 3 times a square.

    Note 2:  if m and n have the same parity then a and b are 
             not relatively prime, so for relatively prime a,b 
             exactly one of m,n is even.  In this case 
             a+b is 48 times a square and c is divisible by 12.

Theorem:  if a,b are prime and a^3 + b^3 = c^2, then
          48 divides a+b with the quotient a square, 
          and 12 divides c.

proof:  since a and b are both prime we are not in case (1) above,
        see note 2 of that case.  So we are in case (2) above and 
        the result follows by Note 2 of that case.

             
The parameterization in (2) allows us to very quickly find
prime numbers a and b such that a^3 + b^3 = c^2.  Here are 
the first 30, sorted by c, extending Hugo Pfoertner's data. 
Following Paul Leopardi's notation let d=sqrt((a+b)/48).

    m     n           a            b                 c               c/12          a+b      d

    1     2           11           37                228                19           48      1
    6     5         8663         2137             812340             67695        10800     15
    8     7        28703         8929            4935504            411292        37632     28
   10     7        56999         1801           13608420           1134035        58800     35
    8    11        44111        48817           14218512           1184876        92928     44
   11     8        86291         6637           25354032           2112836        92928     44
   10    11        87959        57241           29463060           2455255       145200     55
    7    16        16931       133597           48880608           4073384       150528     56
   13    14       246011       151477          135516108          11293009       397488     91
    9    20        54083       334717          194057640          16171470       388800     90
   16    11       367823         3889          223078944          18589912       371712     88
   17    14       552011       127717          412662012          34388501       679728    119
   14    23       457511       786697          763311948          63609329      1244208    161
   15    22       571019       735781          764539380          63711615      1306800    165
   16    25       765983      1154017         1409359200         117446600      1920000    200
   23    16      1586531        38557         1998370272         166530856      1625088    184
   21    26      1915163      1662229         3408412644         284034387      3577392    273
   22    29      2437751      2446777         5397667572         449805631      4884528    319
   15    38        16139      3882661         7650577620         637548135      3898800    285
   21    34      2305883      3811669         8224333236         685361103      6117552    357
   26    29      4074743      2747449         9401817516         783484793      6822192    377
   25    32      3963299      3716701        10658164800         888180400      7680000    400
   19    40      1296563      5634637        13456391280        1121365940      6931200    380
   28    31      5440991      3600097        14413082712        1201090226      9041088    434
   25    44      4683779      9836221        32471808600        2705984050     14520000    550
   22    47      2238023     10591849        34633513596        2886126133     12829872    517
   32    37      9682703      7139569        35661291456        2971774288     16822272    592
   30    41      8681639      9473161        38787516180        3232293015     18154800    615
   29    44      8142803     11395309        44940252984        3745021082     19538112    638
   29    46      8321723     13032949        52820789196        4401732433     21354672    667

We can also find silly prime curiosities such as: 

let a,b be the 99 digit primes
516311827796740838771674147960359381895640671834628612875993558021288236937751709944319900868251071
and 
164347159141325505114613844644012165100482223256876273832159859778089839875893509442524862953510657
respectively.   Then a^3 + b^3 is the square of an integer and
a/b = 3.14159265358979323846259..

Jim Buddenhagen

The columns headed a, b, c/12, and d are now in the OEIS as sequences A099806 A099807 A098970 A099808 ,  respectively. Finally OEIS has a sequence A099809 ,  for (a2 - a*b + b2)/3  not shown in the table above.

In summary, sequences in OEIS relating to a^3 + b^3 = c^2, 
where a and b are prime and c is a positive integer, are related as follows: 

a:     A099806  these primes are -1 mod 12
b:     A099807  these primes are  1 mod 12
c/12:  A098970  submitted by Hugo Pfoertner.

sqrt((a+b)/48):        A099808
sqrt((a^2-a*b+b^2)/3)  A099809, so

corresponding to the factorization a^3+b^3 = (a+b)*(a^2-a*b+b^2), 
i.e. corresponding to  c^2 = (a+b)*(a^2-a*b+b^2) one has:

(12*A098970)^2 = (48*A099808^2) * (3*A099809^2).

The 48*3 gives 12^2, i.e. the 12 in Hugo's c/12 sequence.

Home