%I #22 Oct 01 2024 08:50:48
%S 0,0,0,0,0,1,0,0,0,2,1,1,0,1,0,0,0,3,2,2,1,2,1,1,0,2,1,1,0,1,0,0,0,4,
%T 3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,3,2,2,1,2,1,1,0,2,1,1,0,1,0,0,0,5,4,4,
%U 3,4,3,3,2,4,3,3,2,3,2,2,1,4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0,4,3,3,2,3
%N Number of non-trailing zeros in binary representation of n.
%C a(n) is also the number of parts smaller than the largest 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 Paolo Xausa, <a href="/A086784/b086784.txt">Table of n, a(n) for n = 0..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BinaryCarrySequence.html">Binary Carry Sequence</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F a(n) = A023416(n) - A007814(n) for n>0.
%F a(2^n) = a(A000079(n)) = 0; a(2^n - 1) = a(A000225(n)) = 0;
%F a(2^n + 1) = a(A000051(n)) = n - 1;
%F a(3*2^n - 1) = a(A055010(n)) = 1 for n>0;
%F a(2^n - 3) = a(A036563(n)) = 1, for n>2;
%F a((4^n - 1)/3) = a(A002450(n)) = n.
%F a(n) = if n mod 4 = 1 then a(floor(n/4)) + A007814(floor(n/2)) else a(floor(n/2)); a(0) = a(1) = 0.
%e a(34) = 3; indeed the binary representation of 34 is 100010, having 3 non-trailing zeros. - _Emeric Deutsch_ Jul 24 2017
%p a := proc (n) local b, c: b := proc (n) if `mod`(n, 2) = 0 then 1+b((1/2)*n) else 0 end if end proc: c := proc (n) if n = 0 then 2 elif n = 1 then 0 elif `mod`(n, 2) = 0 then 1+c((1/2)*n) else c((1/2)*n-1/2) end if end proc: if n = 0 then 0 else c(n)-b(n) end if end proc: seq(a(n), n = 0 .. 101); # b and c are the Maple programs for A007814 and A023416, respectively. - _Emeric Deutsch_ Jul 24 2017
%t A086784[n_] := If[n == 0, 0, DigitCount[n, 2, 0] - IntegerExponent[n, 2]];
%t Array[A086784, 100, 0] (* _Paolo Xausa_, Oct 01 2024 *)
%o (Python)
%o def A086784(n): return bin(n>>(~n & n-1).bit_length())[2:].count('0') if n else 0 # _Chai Wah Wu_, Oct 14 2022
%Y Cf. A007088.
%K nonn,base
%O 0,10
%A _Reinhard Zumkeller_, Aug 03 2003