|
|
A352423
|
|
Numbers that are the sum of some number of consecutive prime cubes.
|
|
1
|
|
|
8, 27, 35, 125, 152, 160, 343, 468, 495, 503, 1331, 1674, 1799, 1826, 1834, 2197, 3528, 3871, 3996, 4023, 4031, 4913, 6859, 7110, 8441, 8784, 8909, 8936, 8944, 11772, 12167, 13969, 15300, 15643, 15768, 15795, 15803, 19026, 23939, 24389, 26136, 27467, 27810, 27935, 27962, 27970, 29791
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
PROG
|
(PARI) lista(nn) = {my(list = List(), ip = primepi(nn), vp = primes(ip)); for(i=1, ip, my(s=vp[i]^3); listput(list, s); for (j=i+1, ip, s += vp[j]^3; if (s >vp[ip]^3, break); listput(list, s); ); ); Vec(vecsort(list, , 8)); }
(Python)
import heapq
from sympy import prime
from itertools import islice
def agen(): # generator of terms
p = prime(1)**3; h = [(p, 1, 1)]; nextcount = 2
while True:
(v, s, l) = heapq.heappop(h)
yield v
if v >= p:
p += prime(nextcount)**3
heapq.heappush(h, (p, 1, nextcount))
nextcount += 1
v -= prime(s)**3; s += 1; l += 1; v += prime(l)**3
heapq.heappush(h, (v, s, l))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|