OFFSET
0,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = a(n-1) + a(n-2) - a(n-3) + 4 = 3*a(n-1) - 3*a(n-2) + a(n-3).
From Vincenzo Librandi, Feb 26 2012: (Start)
G.f.: (30 - 7*x - 21*x^2)/(1-x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). (End)
From Amiram Eldar, May 06 2023: (Start)
Sum_{n>=-26} 1/a(n) = -1/1292 - cot(sqrt(646)*Pi)*Pi/(2*sqrt(646)).
Sum_{n>=-26} (-1)^n/a(n) = -1/1292 - cosec(sqrt(646)*Pi)*Pi/(2*sqrt(646)). (End)
E.g.f.: (30 + 53*x + x^2)*exp(x). - Elmo R. Oliveira, Oct 19 2024
MATHEMATICA
LinearRecurrence[{3, -3, 1}, {30, 83, 138}, 50] (* or *) CoefficientList[Series[(-21x^2-7x+30)/(1-x)^3, {x, 0, 60}], x] (* Vincenzo Librandi, Feb 26 2012 *)
PROG
(Magma) I:=[30, 83, 138]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 26 2012
(PARI) for(n=0, 50, print1(n^2 + 52*n + 30", ")); \\ Vincenzo Librandi, Feb 26 2012
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Vincenzo Librandi, Jan 22 2009
EXTENSIONS
Edited by Charles R Greathouse IV, Aug 09 2010
STATUS
approved