login
a(n) is the smallest n-gonal number with binary weight n.
3

%I #8 Dec 11 2022 11:59:37

%S 21,169,117,190,1404,9976,3961,11935,19966,113401,98155,208879,261501,

%T 3338221,916475,3100671,9943039,31457140,50322871,100523871,264240373,

%U 2113871829,2012739435,532673535,7415513007,33017544153,17112759966,50983861215,59039022015

%N a(n) is the smallest n-gonal number with binary weight n.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PolygonalNumber.html">Polygonal Number</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%e 117 is the smallest pentagonal number with binary weight 5 (117_10 = 1110101_2), so a(5) = 117.

%t p[n_, k_] := (n - 2)*k*(k - 1)/2 + k; a[n_] := Module[{k = 1, pk}, While[DigitCount[pk = p[n, k], 2, 1] != n, k++]; pk]; Array[a, 25, 3] (* _Amiram Eldar_, Dec 09 2022 *)

%Y Cf. A000120, A089998, A089999, A358931, A358932.

%K nonn,base

%O 3,1

%A _Ilya Gutkovskiy_, Dec 06 2022