OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = (4*n + 3 + 5*(-1)^n)/2. - Jon E. Schoenfield, Jun 24 2010
From Harvey P. Dale, Jun 28 2011: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3), a(1)=1, a(2)=8, a(3)=5.
G.f.: x*(1 + 7*x - 4*x^2)/((x-1)^2*(1+x)). (End)
E.g.f.: (1/2)*(5 - 8*exp(x) + (3 + 4*x)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 15 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = 1/4 + Pi/8 + 3*log(2)/4. - Amiram Eldar, Feb 23 2023
MATHEMATICA
RecurrenceTable[{a[1]==1, a[n]==4n-a[n-1]+1}, a[n], {n, 80}] (* or *) LinearRecurrence[{1, 1, -1}, {1, 8, 5}, 80] (* Harvey P. Dale, Jun 28 2011 *)
PROG
(Magma) I:=[1, 8, 5]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..70]]; // Vincenzo Librandi, Feb 28 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 20 2009
STATUS
approved