A384161 Sum of next a(n) successive prime cubes is prime.
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
Keywords
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
Links
- Abhiram R Devesh, Table of n, a(n) for n = 1..10000
Crossrefs
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
Comments