OFFSET
0,3
EXAMPLE
a(1) = 1, as 1 is 1 in binary and single runs stay intact (as 2*1 - 1 = 1). a(9) = 17, as 9 is 1001 in binary and keeping the most and the least significant runs as '1' and changing the center run '00' to '000', we get 10001 in binary, 17 in decimal.
PROG
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, May 01 2007
STATUS
approved