OFFSET
0,5
COMMENTS
By convention, a(0) = 0 since n = 0.
Regarding A359215(n), this is the value m that had appeared in S(k), k < n.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..16384
Michael De Vlieger, Scatterplot of a(n) for n = 0..2^14 and for a(n) <= 2^14, showing a curious pattern that scales with n = 2^k.
EXAMPLE
a(1) = 0 since S(1) = {1, 0}, but m = 0 appeared in S(0).
a(2) = 1 since S(2) = {2, 1, ...}, but m = 1 appeared in S(1).
a(3) = 0 since S(3) = {3, 6, 13, 24, 55, 90, 241, 300, 123, 142, 85, 0}, but m = 0 appeared in S(0).
a(4) = 3 since S(4) = {4, 3, ...} but 3 appears in S(3), etc.
a(5) = 0 since S(5) = {5, 0}, but 0 appears in S(0).
a(6) = 6 since 6 appears in F(3).
a(7) = 1 since S(7) = {7, 10, 1, ...} but 1 appears in S(1).
a(8) = 7 since S(8) = {8, 7, ...} but 7 appears in S(7)
a(9) = 4 since S(9) = {9, 4, ...} but 4 appears in S(4).
a(10) = 10 since 10 appears in S(7).
a(11) = 9 since S(11) = {11, 30, 37, 16, 15, 18, 9, ...} but 9 appears in S(9).
a(12) = 10 since S(12) = {12, 27, ..., 39, 10, ...} but 10 appears in S(7), etc.
MATHEMATICA
c[_] = -1; c[0] = 0; f[n_] := BitXor[3 n, 2^IntegerPart[Log2[3 n] + 1] - 1]; Table[(Map[If[c[#1] == -1, Set[c[#1], #2]] & @@ # &, Partition[#, 2, 1]]; Last@ #) &@ NestWhileList[f, n, c[#] == -1 &], {n, 0, 120}]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Michael De Vlieger, Dec 21 2022
STATUS
approved