A359318 a(n) is the smallest square pyramidal number with binary weight n.
0, 1, 5, 14, 30, 55, 819, 506, 1785, 1015, 16206, 51039, 98021, 81375, 1113775, 964535, 2607099, 5494655, 1048061, 6029275, 50331190, 356343295, 534555645, 516941815, 4021378559, 2143222510, 12842950505, 34091142526, 68651299705, 124545644405, 273736383990
Offset: 0
Examples
819 is the smallest square pyramidal number with binary weight 6 (819_10 = 1100110011_2), so a(6) = 819.
Links
- Eric Weisstein's World of Mathematics, Square Pyramidal Number
- Index entries for sequences related to binary expansion of n
Programs
-
Maple
V:= Array(0..40): count:= 0: for k from 1 while count < 40 do m:= k*(k+1)*(2*k+1)/6; w:= convert(convert(m,base,2),`+`); if w <= 40 and V[w] = 0 then count:= count+1; V[w]:= m; fi od: convert(V,list); # Robert Israel, Dec 26 2022
-
Mathematica
seq[len_,nmax_] := Module[{s = Table[0,{len}], n = 0, c = 0, bw, sp}, While[c < len && n < nmax, bw = DigitCount[sp = n*(n+1)*(2*n+1)/6, 2, 1] + 1; If[bw <= len && s[[bw]] == 0, c++; s[[bw]] = sp]; n++]; s]; seq[31, 10^6] (* Amiram Eldar, Dec 26 2022 *)