OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
FORMULA
G.f.: x*(1+2*x-x^2+2*x^3)/((x^2+1)*(x-1)^2). - R. J. Mathar, Oct 08 2011
a(n) = (-2-(-i)^n-i^n+4n)/2 where i=sqrt(-1). - Colin Barker, Jun 06 2012
From Wesley Ivan Hurt, May 30 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4.
E.g.f.: 2 - cos(x) - (1 - 2*x)*exp(x). - Ilya Gutkovskiy, May 30 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = 3*Pi/16 + 3*log(2)/8. - Amiram Eldar, Dec 24 2021
MAPLE
MATHEMATICA
Table[(4n-2-(-I)^n-I^n)/2, {n, 80}] (* Wesley Ivan Hurt, May 30 2016 *)
LinearRecurrence[{2, -2, 2, -1}, {1, 4, 5, 6}, 70] (* Harvey P. Dale, Dec 04 2018 *)
PROG
(Sage) [lucas_number1(n, 0, 1)+2*n+1 for n in range(0, 56)] # Zerinvary Lajos, Jul 06 2008
(Magma) [n : n in [0..150] | n mod 8 in [1, 4, 5, 6]]; // Wesley Ivan Hurt, May 30 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved