OFFSET
1,1
COMMENTS
Essentially the same as A168418.
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
From R. J. Mathar, Jan 05 2011: (Start)
a(n) = 9*n - a(n-1) + 1 for n > 1.
G.f.: x*(5 + 9*x - 5*x^2)/( (1+x)*(x-1)^2 ). (End)
E.g.f.: (1/4)*(9 - 20*exp(x) + (11 + 18*x)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
a(n) = a(n-1) + a(n-2) - a(n-3). - Wesley Ivan Hurt, Aug 17 2021
MAPLE
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {5, 14, 14}, 60] (* Vincenzo Librandi, Feb 28 2012 *)
PROG
(Magma) I:=[5, 14, 14]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 28 2012
(PARI) a(n)=(11+18*n+9*(-1)^n)/4 \\ Charles R Greathouse IV, Jul 16 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 20 2009
STATUS
approved