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!)
A359400 Sum of positions of zeros in the reversed binary expansion of n, where positions in a sequence are read starting with 1 from the left. 5
1, 0, 1, 0, 3, 2, 1, 0, 6, 5, 4, 3, 3, 2, 1, 0, 10, 9, 8, 7, 7, 6, 5, 4, 6, 5, 4, 3, 3, 2, 1, 0, 15, 14, 13, 12, 12, 11, 10, 9, 11, 10, 9, 8, 8, 7, 6, 5, 10, 9, 8, 7, 7, 6, 5, 4, 6, 5, 4, 3, 3, 2, 1, 0, 21, 20, 19, 18, 18, 17, 16, 15, 17, 16, 15, 14, 14, 13 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
FORMULA
a(n) = binomial(A029837(n)+1, 2) - A029931(n), for n>0.
EXAMPLE
The reversed binary expansion of 100 is (0,0,1,0,0,1,1), with zeros at positions {1,2,4,5}, so a(100) = 12.
MATHEMATICA
Table[Total[Join@@Position[Reverse[IntegerDigits[n, 2]], 0]], {n, 0, 100}]
PROG
(C)
long A359400(long n) {
long result = 0, counter = 1;
do {
if (n % 2 == 0)
result += counter;
counter++;
n /= 2;
} while (n > 0);
return result; } // Frank Hollstein, Jan 06 2023
(Python)
def a(n): return sum(i for i, bi in enumerate(bin(n)[:1:-1], 1) if bi=='0')
print([a(n) for n in range(78)]) # Michael S. Branicky, Jan 09 2023
CROSSREFS
The number of zeros is A023416, partial sums A059015.
Row sums of A368494.
For positions of 1's we have A029931, non-reversed A230877.
The non-reversed version is A359359.
A003714 lists numbers with no successive binary indices.
A030190 gives binary expansion, reverse A030308.
A039004 lists the positions of zeros in A345927.
Sequence in context: A194763 A194741 A194753 * A323908 A098825 A111460
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, Jan 05 2023
STATUS
approved

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 16 14:51 EDT 2024. Contains 371749 sequences. (Running on oeis4.)