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.

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

This page as a plain text file.
%I A384161 #24 Jun 09 2025 21:01:05
%S A384161 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,
%T A384161 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,
%U A384161 75,3,73,3,3,5,3,23,9,7,3,71,55,35,7,71,71,19,33,15
%N A384161 Sum of next a(n) successive prime cubes is prime.
%C A384161 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.
%H A384161 Abhiram R Devesh, <a href="/A384161/b384161.txt">Table of n, a(n) for n = 1..10000</a>
%e A384161 Primes, their cubes and the lengths of the blocks when summed becomes a prime.
%e A384161 Primes 2,  3,   5,   7,   11,   13,   17,   19,    23,    29,    31,    37,    41
%e A384161 Cubes  8, 27, 125, 343, 1331, 2197, 4913, 6859, 12167, 24389, 29791, 50653, 68921
%e A384161       \--------------/  \------------------------------------------/ \---...
%e A384161 Sum         503                           81647
%e A384161 a(n) =       4                              7
%p A384161 i:= 0: p:= 0: t:= 0: count:= 0: R:= NULL:
%p A384161 while count < 100 do
%p A384161   p:= nextprime(p);
%p A384161   i:= i+1;
%p A384161   t:= t + p^3;
%p A384161   if isprime(t) then
%p A384161     R:= R, i; count:= count+1; i:= 0; t:= 0;
%p A384161   fi
%p A384161 od:
%p A384161 R; # _Robert Israel_, May 25 2025
%t A384161 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 *)
%o A384161 (Python)
%o A384161 from itertools import count, islice
%o A384161 from sympy import isprime, nextprime
%o A384161 def agen(): # generator of terms
%o A384161     s, i, p = 0, 1, 2
%o A384161     while True:
%o A384161         while not(isprime(s:=s+p**3)): i, p = i+1, nextprime(p)
%o A384161         yield i
%o A384161         s, i, p = 0, 1, nextprime(p)
%o A384161 print(list(islice(agen(), 71))) # _Michael S. Branicky_, May 23 2025
%Y A384161 Cf. A030078, A073684 (sum of successive primes), A383504 (sum of successive prime squares).
%K A384161 nonn
%O A384161 1,1
%A A384161 _Abhiram R Devesh_, May 20 2025