OFFSET
3,1
LINKS
Eric Weisstein's World of Mathematics, Polygonal Number
MATHEMATICA
p[n_, k_] := (n - 2)*k*(k - 1)/2 + k; a[n_] := Module[{k = 1}, While[Plus @@ IntegerDigits[p[n, k]] != n, k++]; k]; Array[a, 60, 3] (* Amiram Eldar, Dec 16 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ilya Gutkovskiy, Dec 16 2022
STATUS
approved