Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #10 May 13 2019 05:24:41
%S 1,1,2,1,3,3,3,1,3,2,8,3,8,5,4,1,3,3,8,3,5,8,15,3,8,8,15,5,10,7,5,1,3,
%T 3,8,2,7,7,15,3,7,3,9,7,7,15,28,3,8,7,15,7,15,7,24,5,10,9,17,7,11,9,6,
%U 1,3,3,8,3,7,7,15,3,5,8,14,8,14,11,28,3,7
%N For any n > 0, let f_n be the lexicographically earliest sequence of distinct positive terms such that the concatenation of the binary representation of its terms, without leading zeros, corresponds to the binary representation of n repeated indefinitely. Apparently, n always appears in f_n. a(n) gives the index of n in f_n.
%C In other words, f_n(a(n)) = n.
%H Rémy Sigrist, <a href="/A308093/b308093.txt">Table of n, a(n) for n = 1..8192</a>
%H Rémy Sigrist, <a href="/A308093/a308093.gp.txt">PARI program for A308093</a>
%F a(2^k) = 1 for any k >= 0.
%F a(2^k-1) = k for any k > 0.
%F a(n) = 2 iff n = A007582(k) for some k > 0.
%e The first terms, alongside the binary representations of n and the first terms of f_n, are:
%e n a(n) bin(n) bin(f_n)
%e -- ---- ------ -----------------------------------------
%e 1 1 1 1,...
%e 2 1 10 10,...
%e 3 2 11 1,11,...
%e 4 1 100 100,...
%e 5 3 101 10,1,101,...
%e 6 3 110 1,10,110,...
%e 7 3 111 1,11,111,...
%e 8 1 1000 1000,...
%e 9 3 1001 100,1,1001,...
%e 10 2 1010 10,1010,...
%e 11 8 1011 10,1,110,11,101,1101,11011,1011,...
%e 12 3 1100 1,100,1100,...
%e 13 8 1101 1,10,11,101,110,1110,11101,1101,...
%e 14 5 1110 1,110,11,10,1110,...
%e 15 4 1111 1,11,111,1111,...
%e 16 1 10000 10000,...
%e 17 3 10001 1000,1,10001,...
%e 18 3 10010 100,10,10010,...
%e 19 8 10011 100,1,1100,11,1001,11001,110011,10011,...
%e 20 3 10100 10,100,10100,...
%o (PARI) See Links section.
%Y Cf. A007582.
%K nonn,base
%O 1,3
%A _Rémy Sigrist_, May 12 2019