OFFSET
1,2
COMMENTS
Subsequences from a(2^m) to a(2^(m+1) - 1) for m >= 0 contain all numbers k such that 2^m <= k < 2^(m+1). This fact was proved (see Peter J. Taylor link).
LINKS
Peter J. Taylor, Permutation of the natural numbers from operation related to binary expansion of n, answer to question on MathOverflow (2023).
PROG
(PARI) b(n)=my(L=logint(n, 2), A=n); for(i=0, L, A+=2^i*bittest(A, L-i)); A;
a(n)=(b(2*n) - 1)/2 - n
CROSSREFS
KEYWORD
nonn
AUTHOR
Mikhail Kurkov, Jun 11 2022
STATUS
approved