login
A359318
a(n) is the smallest square pyramidal number with binary weight n.
1
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,3
EXAMPLE
819 is the smallest square pyramidal number with binary weight 6 (819_10 = 1100110011_2), so a(6) = 819.
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 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ilya Gutkovskiy, Dec 25 2022
STATUS
approved