OFFSET
4,1
LINKS
Eric Weisstein's World of Mathematics, Centered Polygonal Number.
Wikipedia, Centered polygonal number.
EXAMPLE
a(16) = 5 since 16 is a centered pentagonal number, but not a centered square or centered triangular number.
MATHEMATICA
seq[len_] := Module[{s = Table[0, {len}], c = 0, k = 3, n, ckn}, While[c < len, n = 2; While[(ckn = k*n*(n - 1)/2 - 2) <= len, If[s[[ckn]] == 0, c++; s[[ckn]] = k]; n++]; n = 4; k++]; s]; seq[100] (* Amiram Eldar, Mar 06 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Feb 15 2023
STATUS
approved