OFFSET
0,4
COMMENTS
a(n) divides A289296(n).
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
FORMULA
G.f.: (x^3 + x^2 - x + 1)/((x - 1)^2*(x^2 + 1)).
a(n) = n if n == 3 (mod 4), and a(n) = a(n-4) + 4 otherwise, for n>2.
a(n) = a(n+20) - 20.
a(n) = 2*A004524(n) + 1.
a(n) + A290562(n) = 2*n.
A290562(n) = -a(-n).
From Colin Barker, Aug 06 2017: (Start)
a(n) = ((-i)^n + i^n)/2 + n where i=sqrt(-1).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>3. (End)
MAPLE
MATHEMATICA
a[n_] := n + Cos[n*Pi/2]; Table[a[n], {n, 0, 60}]
PROG
(PARI) a(n) = n + round(cos(n*Pi/2)); \\ Michel Marcus, Aug 06 2017
(PARI) Vec((x^3 + x^2 - x + 1)/((x - 1)^2*(x^2 + 1)) + O(x^100)) \\ Colin Barker, Aug 06 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jean-François Alcover and Paul Curtz, Aug 06 2017
STATUS
approved