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.

A352423 Numbers that are the sum of some number of consecutive prime cubes.

Original entry on oeis.org

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

Views

Author

Michel Marcus, Apr 26 2022

Keywords

Crossrefs

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