login
A122729
Primes that are the sum of 5 positive cubes.
2
5, 19, 31, 59, 71, 83, 89, 97, 101, 109, 127, 131, 157, 181, 199, 227, 233, 241, 251, 257, 269, 281, 283, 293, 307, 331, 347, 349, 353, 373, 379, 409, 421, 431, 433, 443, 449, 461, 487, 499, 503, 523, 541, 557, 563, 569, 587, 593, 599, 601, 619, 631, 647, 661
OFFSET
1,1
COMMENTS
By parity, there must be an odd number of odds in the sum. Hence this sequence is the union of primes which are the sum of five odd cubes (such as 5 = 1^3 + 1^3 + 1^3 + 1^3 + 1^3); primes which are the sum of the cube of two even numbers and the cubes of three odd numbers (such as 19 = 1^3 + 1^3 + 1^3 + 2^3 + 2^3); and the primes which are the sum of the cube of an odd number and the cubes of four even numbers (such as 59 = 3^3 + 2^3 + 2^3 + 2^3 + 2^3). A subset of this sequence is the primes which are the sum of the cubes of five distinct primes (i.e. of the form p^3 + q^3 + r^3 + s^3 + t^3 for p, q, r, s, t distinct odd primes) such as 105649 = 3^3 + 5^3 + 7^3 + 11^3 + 47^3. No prime can be the sum of two cubes (by factorization of the sum of two cubes).
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
A000040 INTERSECTION A003328.
EXAMPLE
a(1) = 5 = 1^3 + 1^3 + 1^3 + 1^3 + 1^3.
a(2) = 19 = 1^3 + 1^3 + 1^3 + 2^3 + 2^3.
a(3) = 31 = 1^3 + 1^3 + 1^3 + 1^3 + 3^3.
a(4) = 59 = 3^3 + 2^3 + 2^3 + 2^3 + 2^3.
MATHEMATICA
q = 10; lst = {}; Do[Do[Do[Do[Do[p = a^3 + b^3 + c^3 + d^3 + e^3; If[PrimeQ[p], AppendTo[lst, p]], {e, q}], {d, q}], {c, q}], {b, q}], {a, q}]; Take[Union[lst], 80] (* Vladimir Joseph Stephan Orlovsky, Jul 15 2011 *)
With[{upto=650}, Union[Select[Total/@Tuples[Range[Surd[upto-4, 3]]^3, 5], PrimeQ[ #]&&#<=upto&]]] (* Harvey P. Dale, Sep 30 2018 *)
PROG
(PARI) list(lim)=my(ta, tb, tc, td, te, v=List()); for(a=1, (lim/5)^(1/3), ta=a^3; for(b=a, ((lim-ta)/4)^(1/3), tb=ta+b^3; for(c=b, ((lim-tb)/3)^(1/3), tc=tb+c^3; for(d=c, ((lim-tc)/2)^(1/3), td=tc+d^3; forstep(e=if(td%2==d%2, d+1, d), (lim-td)^(1/3), 2, te=td+e^3; if(ispseudoprime(te), listput(v, te))))))); vecsort(Vec(v), , 8) \\ Charles R Greathouse IV, Jul 15 2011
(Python)
from sympy import isprime
from collections import Counter
from itertools import combinations_with_replacement as combs_w_rep
def aupto(lim):
s = filter(lambda x: x<=lim, (i**3 for i in range(1, int(lim**(1/3))+2)))
s2 = filter(lambda x: x<=lim, (sum(c) for c in combs_w_rep(s, 5)))
s2counts = Counter(s2)
return sorted(filter(isprime, s2counts))
print(aupto(661)) # Michael S. Branicky, May 19 2021
CROSSREFS
Sequence in context: A165557 A138242 A163076 * A347531 A356716 A262700
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Sep 23 2006
STATUS
approved