|
|
A364691
|
|
Pentagonal numbers which are the sum of the first k primes, for some k >= 0.
|
|
5
|
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
5 is a term because it's both a pentagonal number and the sum of the first two primes (2 + 3).
|
|
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 *)
|
|
PROG
|
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,hard,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|