OFFSET
0,3
COMMENTS
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
a(n) = A028310(n), 0 <= n <= 2.
Or without A028310:
a(0) = 1, a(1) = 1, a(2) = 2.
a(n) = n + A006918(n-3), n >= 3.
From Colin Barker, Dec 31 2019: (Start)
G.f.: (1 - x - x^2 + 2*x^3 - x^5 + x^6) / ((1 - x)^4*(1 + x)^2).
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>6.
a(n) = (3 - 3*(-1)^n + (49+3*(-1)^n)*n - 6*n^2 + 2*n^3) / 48.
(End)
PROG
(PARI) Vec((1 - x - x^2 + 2*x^3 - x^5 + x^6) / ((1 - x)^4*(1 + x)^2) + O(x^60)) \\ Colin Barker, Dec 31 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Dec 22 2019
STATUS
approved