OFFSET
0,4
COMMENTS
The function moving to the next overlapping pair in the sequence is f:(i,j) = (j, (i XOR j) + 1) is one-to one. This means that the only possible trajectories for the sequence are loops, "lines", and "rays". The inverse is f^{-1}: (i,j) = (i XOR (j-1), i) is defined except when j = 0. Thus the only infinite non-repeating trajectories are those starting with (i,0) for some i. If we define the size of a pair (i,j) to be the largest power of two <= max(i,j). It is trivial to see that the size of f(i,j) is always >= the size of (i,j). Coupled with the fact there are only finitely many pairs with a given size, this means that "line" trajectories are not possible. Any trajectory that goes to a larger size must be part of a ray, so that tracing back will eventually reach zero. - Franklin T. Adams-Watters, Mar 03 2014
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
FORMULA
a(3n)=2n. a(3n+1)=4*floor((n+1)/2). a(6n+2)=1. a(6n+5)=2^(A001511(n+1)+2)-1.
a(-n) = -a(n) if n == 0 (mod 3), a(-1-n) = -a(n) if n == 1 (mod 3), a(-2-n) = a(n) if n == 2 (mod 3). - Michael Somos, Mar 03 2014
EXAMPLE
G.f. = x^2 + 2*x^3 + 4*x^4 + 7*x^5 + 4*x^6 + 4*x^7 + x^8 + 6*x^9 + 8*x^10 + ...
MATHEMATICA
a[ n_] := If[ n < 0, BitXor[ a[n + 1], a[n + 2] - 1], If[n < 2, 0, 1 + BitXor[ a[n - 1], a[n - 2]]]]; (* Michael Somos, Mar 03 2014 *)
a[ n_] := If[ Mod[n, 3] == 0, 2 n/3, If[ Mod[n, 3] == 1, 4 Quotient[n + 3, 6], If[ n == -1, -1, 2^IntegerExponent[ Fibonacci[n + 1], 2] - 1]]]; (* Michael Somos, Mar 03 2014 *)
nxt[{a_, b_}]:={b, BitXor[a, b]+1}; NestList[nxt, {0, 0}, 80][[All, 1]] (* Harvey P. Dale, Feb 26 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Feb 09 2006
STATUS
approved