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 A090996 #52 Mar 06 2023 21:24:25 %S A090996 0,1,1,2,1,1,2,3,1,1,1,1,2,2,3,4,1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,5,1,1, %T A090996 1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,4,4,5,6,1,1,1,1, %U A090996 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2 %N A090996 Number of leading 1's in binary expansion of n. %C A090996 Mirror of triangle A065120. See example. - _Omar E. Pol_, Oct 17 2013 %C A090996 a(n) is also the least part in the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - _Emeric Deutsch_, Jul 24 2017 %H A090996 Alois P. Heinz, <a href="/A090996/b090996.txt">Table of n, a(n) for n = 0..65535</a> (first 10001 terms from Vincenzo Librandi) %H A090996 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A090996 a(2^k-1)=k; a(A004754(k))=1; a(A004758(k))=2. %F A090996 a(2^k-1)=k; for any other n, a(n) = a(floor(n/2)). %F A090996 a(n) = f(n, 0) with f(n, x) = if n < 2 then n + x else f([n/2], (x+1)*(n mod 2)). - _Reinhard Zumkeller_, Feb 02 2007 %F A090996 Conjecture: a(n) = w(n+1)*(w(n+1)-w(n)+1) - w(2^(w(n+1)+1)-n-1) for n>0, where w(n) = floor(log_2(n)), that is, A000523(n). - _Velin Yanev_, Dec 21 2016 %F A090996 a(n) = A360189(n-1,floor(log_2(n))). - _Alois P. Heinz_, Mar 06 2023 %e A090996 In binary : 14=1110 and there are 3 leading 1's, so a(14)=3. %e A090996 From _Omar E. Pol_, Oct 17 2013: (Start) %e A090996 Written as an irregular triangle with row lengths A011782 the sequence begins: %e A090996 0; %e A090996 1; %e A090996 1,2; %e A090996 1,1,2,3; %e A090996 1,1,1,1,2,2,3,4; %e A090996 1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,5; %e A090996 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,4,4,5,6; %e A090996 Right border gives A001477. Row sums give A000225. %e A090996 (End) %p A090996 a := proc(n) if type(log[2](n+1), integer) then log[2](n+1) else a(floor((1/2)*n)) end if end proc: seq(a(n), n = 0 .. 200); # _Emeric Deutsch_, Jul 24 2017 %p A090996 # second Maple program: %p A090996 b:= proc(n, t) `if`(n=0, t, %p A090996 b(iquo(n, 2, 'm'), m*(t+1))) %p A090996 end: %p A090996 a:= n-> b(n, 0): %p A090996 seq(a(n), n=0..127); # _Alois P. Heinz_, Mar 06 2023 %t A090996 Join[{0},Table[Length@First@Split@IntegerDigits[n,2],{n,30}]] (* _Birkas Gyorgy_, Mar 09 2011 *) (* adapted by _Vincenzo Librandi_, Dec 23 2016 *) %o A090996 (PARI) a(n) = if(n==0, 0); b=binary(n+1); if(hammingweight(b) == 1, #b-1, a(n\2)) \\ _David A. Corneth_, Jul 24 2017 %o A090996 (PARI) a(n) = if(n==0, 0); my(b = binary(n), r = #b); for(i=2, #b, if(!b[i], return(i-1))); r \\ _David A. Corneth_, Jul 24 2017 %Y A090996 a(n) = A007814(1+A030101(n)). %Y A090996 Cf. A279209, A279210, A360189. %K A090996 nonn,base %O A090996 0,4 %A A090996 _Benoit Cloitre_, Feb 29 2004 %E A090996 Edited and corrected by _Franklin T. Adams-Watters_, Apr 08 2006 %E A090996 Sequence had accidentally been shifted left by one step, which was corrected and term a(0)=0 added by _Antti Karttunen_, Jan 01 2007