OFFSET
1,1
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 + 3*(-1)^n)/2. - Jon E. Schoenfield, Jun 24 2010
a(n) = a(n-1) + a(n-2) - a(n-3), a(1)=2, a(2)=7, a(3)=6. - Harvey P. Dale, Feb 04 2012
G.f.: x*(2 + 5*x - 3*x^2)/((-1+x)^2*(1+x)). - Harvey P. Dale, Feb 04 2012
E.g.f.: (1/2)*(3 - 6*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/3 + Pi/8 - log(2)/4. - Amiram Eldar, Feb 23 2023
MATHEMATICA
RecurrenceTable[{a[1]==2, a[n]==4n-a[n-1]+1}, a, {n, 70}] (* or *) LinearRecurrence[{1, 1, -1}, {2, 7, 6}, 70] (* Harvey P. Dale, Feb 04 2012 *)
PROG
(Magma) I:=[2, 7, 6]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..60]]; // Vincenzo Librandi, Feb 28 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 20 2009
STATUS
approved