# How can I tell whether an integer is the sum of two fourth powers

The three integers below can be expressed as the sum of two squares. The three integers are:

\begin{align}(1)&&11,572,060,353,961,555,386,606,814,001 \\(2)&&11,573,624,522,376,724,598,676,284,401 \\(3)&&11,575,215,560,569,326,509,742,400,801\end{align}

Can anyone tell me how to use SageMath (Computer Algebra System) to check whether any of these three integers is the sum of two fourth powers ?

• How do you know they can be expressed as the sum of two squares? – Barry Cipra Mar 14 '17 at 15:05
• The first one is divisible by $101$ which is of the form $8k+5$. Easy to see that we can't even solve $a^4+b^4\equiv 0\pmod 8$ non-trivially unless $p\equiv 1 \pmod 8$ – lulu Mar 14 '17 at 15:11
• Do you want something elegant, or just the answer. If the latter it might be an option to just loop through all fourth powers below the number, that's less than ten million, and check if the difference is also a fourth power. (To check this is rather cheap.) You can restrict to all odd fourth powers in the loop, for obvious parity reaons. – quid Mar 14 '17 at 15:11
• I know the complete factorization of all three integers. For example 11573624522376724598676284401 = 41 * 617 * 2593 * 1661353 * 106202791239577. Note that all the prime factors of this integer are of the form 4n+1 . They are congruent to 1 (mod 4) . – Derek Mar 14 '17 at 15:12
• These commas are confusing, at start I though it was a list, thin spaces would be better. – zwim Mar 14 '17 at 15:35

If $n=(a_1^2+b_1^2)(a_2^2+b_2^2)(a_3^2+b_3^2)(a_4^2+b_4^2)(a_5^2+b_5^2)$, as the OP indicates is the case for one of the numbers, then it suffices to consider $16$ possibilities for $n=A^4+B^4$:
$$A^2+B^2i=(a_1+b_1i)(a_2\pm b_2i)(a_3\pm b_3i)(a_4\pm b_4i)(a_5\pm b_5i)$$
In other words, if you're given a factorization of the number of interest into a handful of primes congruent to $1$ mod $4$, then one approach to testing if the number is a sum of two fourth powers is to express each prime factor as a (unique) sum of two squares, and then test a relatively small number of combinations expressed as Gaussian integers.
• @Derek: You will be interested in this post, More elliptic curves for $x^4+y^4+z^4=1$. There are exactly 31 known below a certain range. It seems a brute-force approach like what you are doing will not yield further solutions within that range, considering the size of the numbers involved. – Tito Piezas III Jul 26 '17 at 4:27