A352423 Numbers that are the sum of some number of consecutive prime cubes.
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
Offset: 1
Keywords
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
- Cathal O'Sullivan, Jonathan P. Sorenson, and Aryn Stahl, An Algorithm to Find Sums of Consecutive Powers of Primes, arXiv:2204.10930 [math.NT], 2022-2023. See S3 p. 10.
Programs
-
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)) print(list(islice(agen(), 47))) # Michael S. Branicky, Apr 26 2022
Comments