OFFSET
0,1
COMMENTS
A self-inverse permutation of the natural numbers. - Philippe Deléham, Nov 22 2016
REFERENCES
E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 60.
J. H. Conway, On Numbers and Games. Academic Press, NY, 1976, pp. 51-53.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..10000
Stephen Wolfram, P vs. NP and the Difficulty of Computation: A Ruliological Approach, 2026.
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,-1,2,-1)
FORMULA
G.f.: (4-3*x-4*x^4+5*x^5)/((1-x)^2(1+x^4)). - Ralf Stephan, Apr 24 2004
a(n) = n + 4*(-1)^[n/4]. - Mitchell Harris, Jan 10 2005
a(n) = n XOR 4, where XOR is the bitwise XOR operator. - Paolo Xausa, Apr 20 2026
a(n) ~ n. - Charles R Greathouse IV, May 31 2026
MATHEMATICA
BitXor[Range[0, 100], 4] (* Paolo Xausa, Apr 20 2026 *)
PROG
(PARI) a(n)=n+if(n%8>3, -4, 4) \\ Charles R Greathouse IV, May 31 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Paolo Xausa, Apr 20 2026
STATUS
approved
