OFFSET
1,2
COMMENTS
Each "run" of binary digit b (0 or 1) is bounded by digits equal to 1-b, or is bounded by the edge of the binary string (which is n written in binary).
For all odd n, the values of all permutations of binary n are themselves odd, since there are an odd number of runs (the first and last runs being of 1's).
EXAMPLE
20 in binary is 10100. So we have a run of one 1, followed by a run of one 0, followed by a run of one 1, followed finally by a run of two 0's. The permutations of the runs of 0's and the run's of 1's form these distinct binary numbers: 00101 (5 in decimal), 01001 (9 in decimal), 10010 (18 in decimal), and 10100 (20 in decimal). So a(20) = 4 since there are 4 such permutations.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Feb 01 2010
EXTENSIONS
Extended by Ray Chandler, Feb 07 2010
STATUS
approved