OFFSET
3,1
LINKS
Ilya Gutkovskiy, Scatterplot of a(n) up to n=10000
Eric Weisstein's World of Mathematics, Centered Polygonal Number
FORMULA
MATHEMATICA
Table[PrimePi[SelectFirst[n # (# + 1)/2 + 1 & /@ Range[100], PrimeQ]], {n, 3, 65}] /. (PrimePi[Missing["NotFound"]] -> -1)
PROG
(PARI) a(n) = if ((n==8) || (n==9), return(-1)); my(k=0, p); while (!isprime(p=1+n*k*(k-1)/2), k++); primepi(p); \\ Michel Marcus, Sep 27 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Sep 25 2023
STATUS
approved