# When is the sum of two squares the sum of two cubes

When does $a^2+b^2 = c^3 +d^3$ for all integer values $(a, b, c, d) \ge 0$. I believe this only happens when: $a^2 = c^3 = e^6$ and $b^2 = d^3 = f^6$. With the following exception:

• $1^3+2^3 = 3^2 + 0^2$

Would that statement be correct?

Is there a general formula for when this happens?

• A small amount of trial and error gives $27^2+72^2=10^3+17^3$. I suspect there will be many solutions. – David Jun 26 '14 at 1:08
• If you allow zero, there are definitely lots more possibilities. Set $a=b$, and $d=0$. Then you want to solve $2b^2=c^3$. Make $b$ and $c$ powers of $2$, so that you end up with $2^{1+2k}=2^{3m}$ for some integers $k,m$. Now you just need to solve $1+2k=3m$, which has an infinite number of positive solutions (because 2 and 3 are relatively prime). – process91 Jun 26 '14 at 1:11
• An integer $n$ is the sum of two squares if and only if the following condition holds: $n$ does not have any prime factor $p=4k+3$ to an odd power. You could try to find out when this happens for $n=c^3+d^3$. I believe the smallest solution, other than the ones you mentioned, is $4^2+7^2=1^3+4^3$. – David Jun 26 '14 at 1:12
• There is, I think, no simple criterion for an integer to be a sum of two cubes, so it's unlikely that there will be "a general formula for when this happens". – Gerry Myerson Jun 26 '14 at 1:40
• A possible approach to prove that there is an infinite family of non-trivial solution is to find an algebraic identity like $$(ax^2+bx+c)^3+(dx^2+ex+f)^3=(gx^3+hx^2+ix+j)^2+(kx^3+lx^2+mx+n)^2.$$ It may happen that $a^3+d^3=g^2+k^2$ and $c^3+f^3=j^2+n^2$ lead to a new non-trivial solution by Vieta jumping. – Jack D'Aurizio Jun 26 '14 at 2:50

Equation:

$$x^2+y^2=z^3+u^3$$

Formula of the solution, you can write:

$$x=q^6-2(a+s+t)q^5+(t^2-2(4a+3s)t-3a^2-10as-s^2)q^4-$$ $$-4(3t^3+(5a+4s)t^2+(3a^2+2as+s^2)t+a(a^2-s^2))q^3+$$ $$+(7t^4+4(a+s)t^3+6(3a^2+2as+s^2)t^2+4(3a^3+9sa^2+3as^2-s^3)t+3a^4+12sa^3+$$ $$+18s^2a^2-4as^3-s^4)q^2-(t^2-2ts+a^2-2as-s^2)(10t^3+18(a+s)t^2+$$ $$+2(5a^2+8as+5s^2)t+2(a^3+sa^2+as^2+s^3))q+(t^2-2at-a^2-2as+s^2)(7t^4+$$ $$+10(a+s)t^3+8(a^2+as+s^2)t^2+2(a^3+sa^2+as^2+s^3)t+a^4+2a^2s^2+s^4)$$

$$..............................................................$$

$$y=q^6+2(a+s+t)q^5+(t^2-2(3a+4s)t-a^2-10as-3s^2)q^4+$$ $$+4(3t^3+(4a+5s)t^2+(a^2+2as+3s^2)t+s(s^2-a^2))q^3+$$ $$+(7t^4+4(a+s)t^3+6(a^2+2as+3s^2)t^2+4(-a^3+3sa^2+9as^2+3s^3)t-a^4-4sa^3+$$ $$+18a^2s^2+12as^3+3s^4)q^2+(t^2-2at-a^2-2as+s^2)(10t^3+18(a+s)t^2+$$ $$+2(5a^2+8as+5s^2)t+2(a^3+sa^2+as^2+s^3))q+(t^2-2ts+a^2-2as-s^2)(7t^4+$$ $$+10(a+s)t^3+8(a^2+as+s^2)t^2+2(a^3+sa^2+as^2+s^3)t+a^4+2a^2s^2+s^4)$$

$$.............................................................$$

$$z=q^4-2(t^2+a^2+s^2+4at+4as+4st)q^2-3t^4-8(a+s)t^3-$$ $$-2(a^2+4as+s^2)t^2+a^4+2a^2s^2+s^4$$

$$..............................................................$$

$$u=(q^2+t^2+a^2+s^2)(q^2+5t^2+4(a+s)t+a^2+s^2)$$

$q,a,s,t$ - integers of any sign.

After substitution and obtain numerical results. It should be divided into common divisor. To get a primitive solution.

1. $$a=x^3-3x^2y-3xy^2+y^3,b=x^3+3x^2y-3xy^2-y^3,c=d=x^2+y^2.$$

2. $$a=3(x^3-3xy^2),b=3(3x^2y-y^3),c=x^2+y^2,d=2(x^2+y^2)$$

$$\cdots$$

See this post.

• And how to be with relatively Prime numbers? Is there still a mutually simple solutions. – individ Jun 26 '14 at 4:37

Let $c=x^2,d=y^2,i=\sqrt{-1}$, then $$c^3+d^3=x^6+y^6=(x^3-(yi)^3)(x^3+(yi)^3)\\ =(x-yi)(x^2+xyi-y^2)(x+yi)(x^2-xyi-y^2)$$

Let $a+bi=(x-yi)(x^2-xyi-y^2),a-bi=(x+yi)(x^2+xyi-y^2)$, then $a^2+b^2=c^3+d^3$.

We get $a=x^3-2xy^2,b=y^3-2x^2y,c=x^2,d=y^2.$

If $a<0$ or $b<0$, we can take the absolute value.

For example, let $x=1,y=2$ we get $a=-7,b=4,c=1,d=4$ hence $7^2+4^2=1^3+4^3,$

let $x=3,y=2,$ we get $a=3,b=-28,c=9,d=4$ hence $3^2+28^2=9^3+4^3.$

• But what if not the squares? – individ Jun 26 '14 at 6:57
• You get a private decision. The formula in General has a bulky look. – individ Jun 26 '14 at 6:59

Not really natural to demand both cubes positive...

           1           1           2 = 2
1           0           1 =  1
2           2          16 = 2^4
2           1           9 = 3^2
2           0           8 = 2^3
3          -1          26 = 2 * 13
4           4         128 = 2^7
4           2          72 = 2^3 * 3^2
4           1          65 = 5 * 13
4           0          64 = 2^6
4          -3          37 = 37
5           5         250 = 2 * 5^3
5           0         125 = 5^3
5          -2         117 = 3^2 * 13
5          -3          98 = 2 * 7^2
5          -4          61 = 61
6          -2         208 = 2^4 * 13
7           5         468 = 2^2 * 3^2 * 13
7           3         370 = 2 * 5 * 37
7          -5         218 = 2 * 109
8           8        1024 = 2^10
8           5         637 = 7^2 * 13
8           4         576 = 2^6 * 3^2
8           2         520 = 2^3 * 5 * 13
8           0         512 = 2^9
8          -3         485 = 5 * 97
8          -6         296 = 2^3 * 37
8          -7         169 = 13^2
9           9        1458 = 2 * 3^6
9           8        1241 = 17 * 73
9           4         793 = 13 * 61
9           1         730 = 2 * 5 * 73
9           0         729 = 3^6
9          -7         386 = 2 * 193
10          10        2000 = 2^4 * 5^3
10           5        1125 = 3^2 * 5^3
10           0        1000 = 2^3 * 5^3
10          -4         936 = 2^3 * 3^2 * 13
10          -6         784 = 2^4 * 7^2
10          -7         657 = 3^2 * 73
10          -8         488 = 2^3 * 61
11           1        1332 = 2^2 * 3^2 * 37
12           5        1853 = 17 * 109
12          -4        1664 = 2^7 * 13
12          -7        1385 = 5 * 277
12         -11         397 = 397
13          13        4394 = 2 * 13^3
13          12        3925 = 5^2 * 157
13          11        3528 = 2^3 * 3^2 * 7^2
13           2        2205 = 3^2 * 5 * 7^2
13           0        2197 = 13^3
13          -1        2196 = 2^2 * 3^2 * 61
13          -8        1685 = 5 * 337
13         -11         866 = 2 * 433
14          13        4941 = 3^4 * 61
14          10        3744 = 2^5 * 3^2 * 13
14           6        2960 = 2^4 * 5 * 37
14           1        2745 = 3^2 * 5 * 61
14          -7        2401 = 7^4
14         -10        1744 = 2^4 * 109
14         -11        1413 = 3^2 * 157
15          11        4706 = 2 * 13 * 181
15          -5        3250 = 2 * 5^3 * 13
16          16        8192 = 2^13
16          10        5096 = 2^3 * 7^2 * 13
16           9        4825 = 5^2 * 193
16           8        4608 = 2^9 * 3^2
16           4        4160 = 2^6 * 5 * 13
16           1        4097 = 17 * 241
16           0        4096 = 2^12
16          -3        4069 = 13 * 313
16          -6        3880 = 2^3 * 5 * 97
16         -12        2368 = 2^6 * 37
16         -14        1352 = 2^3 * 13^2
17          17        9826 = 2 * 17^3
17          12        6641 = 29 * 229
17          10        5913 = 3^4 * 73
17           7        5256 = 2^3 * 3^2 * 73
17           0        4913 = 17^3
17          -2        4905 = 3^2 * 5 * 109
17          -4        4849 = 13 * 373
17          -7        4570 = 2 * 5 * 457
17         -12        3185 = 5 * 7^2 * 13
17         -14        2169 = 3^2 * 241
17         -15        1538 = 2 * 769
18          18       11664 = 2^4 * 3^6
18          16        9928 = 2^3 * 17 * 73
18           9        6561 = 3^8
18           8        6344 = 2^3 * 13 * 61
18           2        5840 = 2^4 * 5 * 73
18           0        5832 = 2^3 * 3^6
18         -14        3088 = 2^4 * 193
19           7        7202 = 2 * 13 * 277
19           5        6984 = 2^3 * 3^2 * 97
19          -7        6516 = 2^2 * 3^2 * 181
19          -9        6130 = 2 * 5 * 613
20          20       16000 = 2^7 * 5^3
20          17       12913 = 37 * 349
20          10        9000 = 2^3 * 3^2 * 5^3
20           5        8125 = 5^4 * 13
20           0        8000 = 2^6 * 5^3
20          -8        7488 = 2^6 * 3^2 * 13
20         -12        6272 = 2^7 * 7^2
20         -14        5256 = 2^3 * 3^2 * 73
20         -15        4625 = 5^3 * 37
20         -16        3904 = 2^6 * 61
jagy@phobeusjunior:~\$