Count Monobit Integers
Count the integers from 0 to n whose binary digits are all the same, which are zero and the numbers of the form 2^L - 1.
Count the integers from 0 to n whose binary digits are all the same, which are zero and the numbers of the form 2^L - 1.