The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A004443 Nimsum n + 2. 10
 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13, 18, 19, 16, 17, 22, 23, 20, 21, 26, 27, 24, 25, 30, 31, 28, 29, 34, 35, 32, 33, 38, 39, 36, 37, 42, 43, 40, 41, 46, 47, 44, 45, 50, 51, 48, 49, 54, 55, 52, 53, 58, 59, 56, 57, 62, 63, 60, 61, 66, 67, 64, 65 (list; graph; refs; listen; history; text; internal format)
 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 N. J. A. Sloane, Table of n, a(n) for n = 0..20000 F. Michel Dekking, Jeffrey Shallit, and N. J. A. Sloane, Queens in exile: non-attacking queens on infinite chess boards, Electronic J. Combin., 27:1 (2020), #P1.52. Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1). FORMULA a(n) = n XOR 2. - Joerg Arndt, Feb 07 2013 G.f.: (2-x-2x^2+3x^3)/((1-x)^2(1+x^2)). - Ralf Stephan, Apr 24 2004 The sequences 'Nimsum n + m' seem to have the general o.g.f. p(x)/q(x) with p, q polynomials and q(x) = (1-x)^2*Product_{k>=0} (1+x^(2^e(k))), with Sum_{k>=0} 2^e(k) = m. - Ralf Stephan, Apr 24 2004 a(n) = n + 2(-1)^floor(n/2). - Mitchell Harris, Jan 10 2005 a(n) = OR(n,2) - AND(n,2). - Gary Detlefs, Feb 06 2013 E.g.f.: 2*(sin(x) + cos(x)) + x*exp(x). - Ilya Gutkovskiy, Jul 01 2016 MAPLE nimsum := proc(a, b) local t1, t2, t3, t4, l; t1 := convert(a+2^200, base, 2); t2 := convert(b+2^200, base, 2); t3 := evalm(t1+t2); map(x->x mod 2, t3); t4 := convert(evalm(%), list); l := convert(t4, base, 2, 10); sum(l[k]*10^(k-1), k=1..nops(l)); end; f := n -> n + 2*(-1)^floor(n/2); # N. J. A. Sloane, Jul 06 2019 MATHEMATICA Table[BitXor[n, 2], {n, 0, 100}] (* T. D. Noe, Feb 09 2013 *) PROG (PARI) a(n)=bitxor(n, 2) \\ Charles R Greathouse IV, Oct 07 2015 (Python) for n in range(20): print(2^n) # Oliver Knill, Feb 16 2020 CROSSREFS Cf. A003987, A004442, A269526. Essentially the same as A256008 - 1. Also the second column of A274528. Sequence in context: A163465 A263230 A319665 * A171616 A323883 A008290 Adjacent sequences:  A004440 A004441 A004442 * A004444 A004445 A004446 KEYWORD nonn,easy AUTHOR STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 29 14:13 EDT 2020. Contains 337431 sequences. (Running on oeis4.)