OFFSET
0,1
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).
FORMULA
a(4*n+1) = 4*n+3, a(4*n+2) = 2*n, a(4*n+3) = 4*n+1, a(4*n+4) = 2*n+3.
From Colin Barker, Apr 19 2016: (Start)
a(n) = ((2+4*i)*(-i)^n+(2-4*i)*i^n-(-3+(-1)^n)*n)/4 for n>0 where i is the imaginary unit.
a(n) = a(n-2)+a(n-4)-a(n-6) for n>6.
G.f.: (2+3*x-2*x^2-2*x^3+x^4+3*x^5+x^6) / ((1-x)^2*(1+x)^2*(1+x^2)).
(End)
From Ilya Gutkovskiy, Apr 19 2016: (Start)
a(n) = (4*floor(1/(n+1)) - (-1)^n*n + 3*n + 8*sin((Pi*n)/2) + 4*cos((Pi*n)/2))/4.
E.g.f.: 1 + cos(x) + x*cosh(x) + 2*sin(x) + x*sinh(x)/2. (End)
PROG
(PARI) Vec((2+3*x-2*x^2-2*x^3+x^4+3*x^5+x^6)/((1-x)^2*(1+x)^2*(1+x^2)) + O(x^50)) \\ Colin Barker, Apr 19 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Antti Karttunen, May 21 2005
STATUS
approved