OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
29 in binary is 11101. Replace the three 1's on the left of the binary representation with one 1, getting 101. a(29) is the decimal equivalent of the result, which is 5.
MAPLE
A163509 := proc(n) bdgs := convert(n, base, 2) ; while op(-1, bdgs) = op(-2, bdgs) do bdgs := subsop(-1=NULL, bdgs) ; od: add( op(d, bdgs)*2^(d-1), d=1..nops(bdgs) ) ; end: seq(A163509(n), n=1..120) ; # R. J. Mathar, Aug 07 2009
MATHEMATICA
Table[FromDigits[Flatten[Join[{1}, Rest[Split[IntegerDigits[n, 2]]]]], 2], {n, 80}] (* Harvey P. Dale, Jul 17 2014 *)
CROSSREFS
KEYWORD
AUTHOR
Leroy Quet, Jul 29 2009
EXTENSIONS
More terms from R. J. Mathar, Aug 07 2009
STATUS
approved