A364691 Pentagonal numbers which are the sum of the first k primes, for some k >= 0.
0, 5, 13490, 3299391550, 22042432252064127, 2387505511919644051, 680588297594638712735
Offset: 1
Examples
5 is a term because it's both a pentagonal number and the sum of the first two primes (2 + 3).
Links
Programs
-
Mathematica
A364691list[kmax_]:=Module[{p=0},Join[{0},Table[If[IntegerQ[(Sqrt[24(p+=Prime[k])+1]+1)/6],p,Nothing],{k,kmax}]]];A364691list[25000] (* Paolo Xausa, Oct 06 2023 *)
-
PARI
ispenta(n) = my(s); issquare(24*n+1,&s)&&s%6==5; my(S=0); forprime (p=2, oo, S+=p; if (ispenta(S), print1(S,", "))) \\ Hugo Pfoertner, Aug 03 2023
Extensions
a(5)-a(7) from Hugo Pfoertner, Aug 04 2023