The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A038585 Write n in binary, delete 0's. 3
1, 1, 11, 1, 11, 11, 111, 1, 11, 11, 111, 11, 111, 111, 1111, 1, 11, 11, 111, 11, 111, 111, 1111, 11, 111, 111, 1111, 111, 1111, 1111, 11111, 1, 11, 11, 111, 11, 111, 111, 1111, 11, 111, 111, 1111, 111, 1111, 1111, 11111, 11, 111, 111, 1111, 111, 1111, 1111 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n) = (9 * n mod 2 + 1) * a(floor(n/2)) + n mod 2. - Reinhard Zumkeller, Oct 10 2012
a(n) = A002275(A000120(n)). - Chai Wah Wu, May 19 2020
MATHEMATICA
Table[FromDigits[DeleteCases[IntegerDigits[n, 2], _?(#==0&)]], {n, 60}] (* Harvey P. Dale, Feb 27 2012 *)
FromDigits/@(IntegerDigits[Range[60], 2]/.(0->Nothing)) (* Harvey P. Dale, Apr 09 2017 *)
PROG
(Haskell)
a038585 0 = 0
a038585 n = (9 * m + 1) * (a038585 n') + m where (n', m) = divMod n 2
-- Reinhard Zumkeller, Oct 10 2012
(Python)
def A038585(n):
return int(bin(n)[2:].replace('0', '')) # Chai Wah Wu, May 19 2020
CROSSREFS
Sequence in context: A281036 A205321 A270838 * A083768 A279695 A282219
KEYWORD
nonn,easy,base,nice
AUTHOR
EXTENSIONS
More terms from Erich Friedman
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 June 7 18:53 EDT 2024. Contains 373206 sequences. (Running on oeis4.)