OFFSET
0,6
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Binary
Eric Weisstein's World of Mathematics, Digit Count
EXAMPLE
n=25->'11001': a(25) = #{'10011'->19, '10101'->21, '10110'->22, '11001'->25, '11010'->26, '11100'->28} = 6.
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).
n=31->'1_1111': C(4,4) = 1.
n=33->'1_00001': C(5,1) = 5 (the one can be in 5 positions).
n=35->'1_00011': C(5,2) = 10. Ruud H.G. van Tol, Apr 17 2014
MATHEMATICA
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Jan 15 2004
EXTENSIONS
Missing a(0)=1 added and offset adjusted by Reinhard Zumkeller, Dec 19 2012
STATUS
approved