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