login
A004445
Nimsum n + 4.
1
4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11, 20, 21, 22, 23, 16, 17, 18, 19, 28, 29, 30, 31, 24, 25, 26, 27, 36, 37, 38, 39, 32, 33, 34, 35, 44, 45, 46, 47, 40, 41, 42, 43, 52, 53, 54, 55, 48, 49, 50, 51, 60, 61, 62, 63, 56, 57, 58, 59, 68, 69, 70, 71, 64, 65, 66, 67, 76
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.
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
Sequence in context: A338625 A046345 A325103 * A174630 A163875 A244586
KEYWORD
nonn,easy
EXTENSIONS
More terms from Paolo Xausa, Apr 20 2026
STATUS
approved