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.

Showing 1-1 of 1 results.

A384161 Sum of next a(n) successive prime cubes is prime.

Original entry on oeis.org

4, 7, 3, 11, 13, 9, 131, 9, 15, 3, 31, 27, 3, 13, 7, 3, 31, 131, 15, 17, 13, 5, 21, 29, 3, 33, 3, 7, 11, 43, 5, 41, 43, 49, 27, 49, 37, 85, 5, 41, 3, 41, 65, 51, 13, 29, 65, 5, 89, 3, 27, 75, 3, 73, 3, 3, 5, 3, 23, 9, 7, 3, 71, 55, 35, 7, 71, 71, 19, 33, 15
Offset: 1

Views

Author

Abhiram R Devesh, May 20 2025

Keywords

Comments

Group the primes such that the sum of cubes of members of each group is a prime, and each successive group is as short as possible.

Examples

			Primes, their cubes and the lengths of the blocks when summed becomes a prime.
Primes 2,  3,   5,   7,   11,   13,   17,   19,    23,    29,    31,    37,    41
Cubes  8, 27, 125, 343, 1331, 2197, 4913, 6859, 12167, 24389, 29791, 50653, 68921
      \--------------/  \------------------------------------------/ \---...
Sum         503                           81647
a(n) =       4                              7
		

Crossrefs

Cf. A030078, A073684 (sum of successive primes), A383504 (sum of successive prime squares).

Programs

  • Maple
    i:= 0: p:= 0: t:= 0: count:= 0: R:= NULL:
    while count < 100 do
      p:= nextprime(p);
      i:= i+1;
      t:= t + p^3;
      if isprime(t) then
        R:= R, i; count:= count+1; i:= 0; t:= 0;
      fi
    od:
    R; # Robert Israel, May 25 2025
  • Mathematica
    p=1;s={};Do[c=0;sm=0;While[!PrimeQ[sm],sm=sm+Prime[p]^3;p++;c++];AppendTo[s,c],{n,71}];s (* James C. McMahon, Jun 09 2025 *)
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        s, i, p = 0, 1, 2
        while True:
            while not(isprime(s:=s+p**3)): i, p = i+1, nextprime(p)
            yield i
            s, i, p = 0, 1, nextprime(p)
    print(list(islice(agen(), 71))) # Michael S. Branicky, May 23 2025
Showing 1-1 of 1 results.