OFFSET
0,3
COMMENTS
See A307485 for further information, motivation & references.
Also, a(n) is the smallest k not yet in the sequence such that bitxor(k,a(n-1)) >= a(n-1). - Giorgos Kalogeropoulos, May 31 2019
LINKS
EXAMPLE
Index n : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
A307485(n): 0, 1, 2, 4, 3, 5, 7, 9, 6, 8, ...
This sequence, the inverse permutation, is obtained by reading the above "from bottom to top", i.e., find the index in 2nd row, return the number above it: e.g., a(3) = 4, a(4) = 3, a(5) = 5, a(6) = 8, a(7) = 6, etc.
MATHEMATICA
a[1]=1; a[n_] := a[n] = (t=1; While[BitXor[a[n-1], t] < a[n-1] || MemberQ[Array[a, n-1], t], t++]; t)
Join[{0}, Table[a[k], {k, 100}]] (* Giorgos Kalogeropoulos, May 31 2019 *)
PROG
CROSSREFS
Cf. A233275 (different permutation based on entangling odd & even numbers).
KEYWORD
nonn
AUTHOR
M. F. Hasler, Apr 18 2019
STATUS
approved