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!)
A090078 In binary expansion of n, reduce contiguous blocks of 0's to 0. 3
0, 1, 2, 3, 2, 5, 6, 7, 2, 5, 10, 11, 6, 13, 14, 15, 2, 5, 10, 11, 10, 21, 22, 23, 6, 13, 26, 27, 14, 29, 30, 31, 2, 5, 10, 11, 10, 21, 22, 23, 10, 21, 42, 43, 22, 45, 46, 47, 6, 13, 26, 27, 26, 53, 54, 55, 14, 29, 58, 59, 30, 61, 62, 63, 2, 5, 10, 11, 10, 21, 22, 23, 10, 21 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(a(n)) = a(n).
a(A090077(n)) = A090077(a(n)) = A090079(n).
EXAMPLE
100 -> '1100100' -> 11[00]1[00] -> 11[0]1[0] -> '11010' -> 26=a(100).
PROG
(PARI) a(n)=my(v=binary(n), t); for(i=1, #v, if(v[i], t+=t+1, t%2, t+=t)); t \\ Charles R Greathouse IV, Aug 17 2016
(Python)
def a(n):
b = bin(n)[2:]
while "00" in b: b = b.replace("00", "0")
return int(b, 2)
print([a(n) for n in range(81)]) # Michael S. Branicky, Jul 27 2022
CROSSREFS
Sequence in context: A072775 A304768 A243057 * A325814 A325126 A327937
KEYWORD
nonn,base,easy
AUTHOR
Reinhard Zumkeller, Nov 20 2003
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 17 21:22 EDT 2024. Contains 371767 sequences. (Running on oeis4.)