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!)
A290155 Let a(n) be the sequence of 0's and 1's that represents n. Then a(0) = 0; and a((1b)_2) = 1a(|b|)b where |b| denotes the length of b. 0

%I #26 May 02 2020 05:34:42

%S 0,10,1100,1101,1110000,1110001,1110010,1110011,11101000,11101001,

%T 11101010,11101011,11101100,11101101,11101110,11101111,111100000000,

%U 111100000001,111100000010,111100000011,111100000100,111100000101,111100000110,111100000111

%N Let a(n) be the sequence of 0's and 1's that represents n. Then a(0) = 0; and a((1b)_2) = 1a(|b|)b where |b| denotes the length of b.

%H Donald E. Knuth, <a href="https://www-cs-faculty.stanford.edu/~knuth/fg.html">Selected Papers on Fun and Games</a>, Stanford, California: Center for the Study of Language and Information (2011).

%e (1)_2 = 1, so a(1) = 1a(0) = 10.

%e (2)_2 = 10, so a(2) = 1a(1)0 = 1100.

%e (3)_2 = 11, so a(3) = 1a(1)1 = 1101.

%e (4)_2 = 100, so a(4) = 1a(2)00 = 1110000.

%e (5)_2 = 101, so a(5) = 1a(2)01 = 1110001.

%e (6)_2 = 110, so a(6) = 1a(2)10 = 1110010.

%e (7)_2 = 111, so a(7) = 1a(2)11 = 1110011.

%e (8)_2 = 1000, so a(8) = 1a(3)000 = 11101000.

%o (Python)

%o def a(n):

%o b = bin(n)[3:]

%o return 0 if n == 0 else int('1' + str(a(len(b))) + b)

%o print([a(n) for n in range(51)]) # _Indranil Ghosh_, Jul 22 2017

%Y Cf. A007088 (binary numbers).

%K nonn

%O 0,2

%A _Seiichi Manyama_, Jul 22 2017

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 July 14 13:51 EDT 2024. Contains 374318 sequences. (Running on oeis4.)