OFFSET
1,1
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
Wikipedia, Polygonal number.
EXAMPLE
5 is a term because the sum of the first 5 primes (2 + 3 + 5 + 7 = 28) is a triangular number.
7 is a term because the sum of the first 7 primes (2 + 3 + 5 + 7 + 11 + 13 = 58) is an octagonal number.
MATHEMATICA
A364693Q[n_]:=With[{d=Divisors[2n]}, Catch[For[i=3, i<Length[d]-1, i++, If[Divisible[2n/d[[i]]-2, d[[i]]-1], Throw[True]]]; False]]; (* After Jianing Song in A090466 *)
A364695list[kmax_]:=Flatten[Position[Map[A364693Q, Accumulate[Prime[Range[kmax]]]], True]]; A364695list[100]
PROG
(PARI) isok(k) = my(s = sum(i=1, k, prime(i))); for (j=3, s-1, if (ispolygonal(s, j), return(1))); \\ Michel Marcus, Aug 03 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo Xausa, Aug 03 2023
STATUS
approved