OFFSET
1,4
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 6 , the Elias gamma code for n is '11010'. In '11010', the positions of '1' followed immediately to the right by '0' counting from left are 2 and 4. So, a(6) = 2 + 4 = 6.
For n = 10, the Elias gamma code for n is '1110010'. In '1110010', the positions of '1' followed immediately to the right by '0' counting from left are 3 and 6. So, a(10) = 3 + 6 = 9.
PROG
(Python)
def a(n):
....x= A281149(n)
....s=0
....for i in range(1, len(x)):
........if x[i-1]=="1" and x[i]=="0":
............s+=i
....return s
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Indranil Ghosh, Jan 24 2017
STATUS
approved