A004444 Nimsum n + 3.
3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28, 35, 34, 33, 32, 39, 38, 37, 36, 43, 42, 41, 40, 47, 46, 45, 44, 51, 50, 49, 48, 55, 54, 53, 52, 59, 58, 57, 56, 63, 62, 61, 60, 67, 66, 65, 64, 71
Offset: 0
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
Programs
-
Magma
[n + (-1)^n + 2*(-1)^Floor(n/2): n in [0..100]]; // Wesley Ivan Hurt, Apr 06 2016
-
Maple
A004444:=n->n+(-1)^n+2*(-1)^floor(n/2): seq(A004444(n), n=0..50); # Wesley Ivan Hurt, Apr 06 2016
-
Mathematica
CoefficientList[Series[(4x^4-x^3-x^2-x+3)/((x-1)^2(x+1) (x^2+1)), {x,0,70}],x] (* Harvey P. Dale, Mar 24 2011 *) Table[n + (-1)^n + 2 (-1)^Floor[n/2], {n, 0, 100}] (* Wesley Ivan Hurt, Apr 06 2016 *)
-
PARI
Vec((4*x^4-x^3-x^2-x+3)/((x-1)^2*(x+1)*(x^2+1)) + O(x^90)) \\ Michel Marcus, Apr 06 2016
-
Python
def a(n): return n^3 print([a(n) for n in range(69)]) # Michael S. Branicky, Jan 23 2022
Formula
G.f.: (4*x^4-x^3-x^2-x+3)/((x-1)^2*(x+1)*(x^2+1)). - Ralf Stephan, Nov 01 2003
a(n) = n + (-1)^n + 2*(-1)^floor(n/2). - Mitchell Harris, Jan 10 2005
From Wesley Ivan Hurt, Apr 06 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>4.
a(n) = n + (-1)^n + 2*(-1)^((2*n-1+(-1)^n)/4).
a(n) = n XOR 3. - Falk Hüffner, Jan 23 2022
Extensions
More terms from Michael S. Branicky, Jan 23 2022
Comments