This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A359318 #10 Feb 16 2025 08:34:04 %S A359318 0,1,5,14,30,55,819,506,1785,1015,16206,51039,98021,81375,1113775, %T A359318 964535,2607099,5494655,1048061,6029275,50331190,356343295,534555645, %U A359318 516941815,4021378559,2143222510,12842950505,34091142526,68651299705,124545644405,273736383990 %N A359318 a(n) is the smallest square pyramidal number with binary weight n. %H A359318 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquarePyramidalNumber.html">Square Pyramidal Number</a> %H A359318 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %e A359318 819 is the smallest square pyramidal number with binary weight 6 (819_10 = 1100110011_2), so a(6) = 819. %p A359318 V:= Array(0..40): count:= 0: %p A359318 for k from 1 while count < 40 do %p A359318 m:= k*(k+1)*(2*k+1)/6; %p A359318 w:= convert(convert(m,base,2),`+`); %p A359318 if w <= 40 and V[w] = 0 then %p A359318 count:= count+1; V[w]:= m; %p A359318 fi %p A359318 od: %p A359318 convert(V,list); # _Robert Israel_, Dec 26 2022 %t A359318 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 *) %Y A359318 Cf. A000120, A000330, A089998, A358931, A359317. %K A359318 nonn,base %O A359318 0,3 %A A359318 _Ilya Gutkovskiy_, Dec 25 2022