login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A090706 Number of numbers having in binary representation the same number of zeros and ones as n has. 7

%I #29 Apr 25 2014 11:36:21

%S 1,1,1,1,1,2,2,1,1,3,3,3,3,3,3,1,1,4,4,6,4,6,6,4,4,6,6,4,6,4,4,1,1,5,

%T 5,10,5,10,10,10,5,10,10,10,10,10,10,5,5,10,10,10,10,10,10,5,10,10,10,

%U 5,10,5,5,1,1,6,6,15,6,15,15,20,6,15,15,20,15,20,20,15,6,15,15,20,15,20

%N Number of numbers having in binary representation the same number of zeros and ones as n has.

%C a(n) = binomial(A070939(n)-1, A000120(n)-1).

%H Reinhard Zumkeller, <a href="/A090706/b090706.txt">Table of n, a(n) for n = 0..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Binary.html">Binary</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DigitCount.html">Digit Count</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(n) = binomial(A070939(n)-1, A023416(n)).

%e n=25->'11001': a(25) = #{'10011'->19, '10101'->21, '10110'->22, '11001'->25, '11010'->26, '11100'->28} = 6.

%e n=23->'1_0111' has 5 bits, and the lower 4 bits can be shuffled. There are 1 zero and 3 ones, so the number of combinations is C(4,1) = 4 (the zero can be in 4 positions).

%e n=31->'1_1111': C(4,4) = 1.

%e n=33->'1_00001': C(5,1) = 5 (the one can be in 5 positions).

%e n=35->'1_00011': C(5,2) = 10. _Ruud H.G. van Tol_, Apr 17 2014

%t a[n_] := Binomial[Length[b = IntegerDigits[n, 2]]-1, Count[b, 0]]; a[0] = 1; Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Apr 25 2014 *)

%o (PARI) A090706 = n->binomial(#binary(n)-1,hammingweight(n)-(n>0)) \\ About 20% faster than the alternative "...-1)+!n". - _M. F. Hasler_, Jan 04 2014

%Y Cf. A007088, A007318, A014312.

%K nonn,base

%O 0,6

%A _Reinhard Zumkeller_, Jan 15 2004

%E Missing a(0)=1 added and offset adjusted by _Reinhard Zumkeller_, Dec 19 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)