cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A122729 Primes that are the sum of 5 positive cubes.

This page as a plain text file.
%I A122729 #16 May 20 2021 04:46:47
%S A122729 5,19,31,59,71,83,89,97,101,109,127,131,157,181,199,227,233,241,251,
%T A122729 257,269,281,283,293,307,331,347,349,353,373,379,409,421,431,433,443,
%U A122729 449,461,487,499,503,523,541,557,563,569,587,593,599,601,619,631,647,661
%N A122729 Primes that are the sum of 5 positive cubes.
%C A122729 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).
%H A122729 Charles R Greathouse IV, <a href="/A122729/b122729.txt">Table of n, a(n) for n = 1..10000</a>
%F A122729 A000040 INTERSECTION A003328.
%e A122729 a(1) =  5 = 1^3 + 1^3 + 1^3 + 1^3 + 1^3.
%e A122729 a(2) = 19 = 1^3 + 1^3 + 1^3 + 2^3 + 2^3.
%e A122729 a(3) = 31 = 1^3 + 1^3 + 1^3 + 1^3 + 3^3.
%e A122729 a(4) = 59 = 3^3 + 2^3 + 2^3 + 2^3 + 2^3.
%t A122729 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 *)
%t A122729 With[{upto=650},Union[Select[Total/@Tuples[Range[Surd[upto-4,3]]^3,5], PrimeQ[ #]&&#<=upto&]]] (* _Harvey P. Dale_, Sep 30 2018 *)
%o A122729 (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
%o A122729 (Python)
%o A122729 from sympy import isprime
%o A122729 from collections import Counter
%o A122729 from itertools import combinations_with_replacement as combs_w_rep
%o A122729 def aupto(lim):
%o A122729   s = filter(lambda x: x<=lim, (i**3 for i in range(1, int(lim**(1/3))+2)))
%o A122729   s2 = filter(lambda x: x<=lim, (sum(c) for c in combs_w_rep(s, 5)))
%o A122729   s2counts = Counter(s2)
%o A122729   return sorted(filter(isprime, s2counts))
%o A122729 print(aupto(661)) # _Michael S. Branicky_, May 19 2021
%Y A122729 Cf. A000040, A003328.
%K A122729 easy,nonn
%O A122729 1,1
%A A122729 _Jonathan Vos Post_, Sep 23 2006