OFFSET
0,5
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
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, Jan 05 2023
STATUS
approved