OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..300
Index entries for linear recurrences with constant coefficients, signature (12,-21,10).
FORMULA
From Vincenzo Librandi, Jun 17 2013: (Start)
G.f.: (1-3*x+11*x^2)/((1-10*x)*(1-x)^2).
a(n) = 12*a(n-1) - 21*a(n-2) + 10*a(n-3) for n > 2. (End)
E.g.f.: exp(x)*exp(9*x) - x). - Elmo R. Oliveira, Sep 06 2024
MATHEMATICA
Table[10^n - n, {n, 0, 20}] (* or *) CoefficientList[Series[(1 - 3 x + 11 x^2) / ((1 - 10 x) (1 - x)^2), {x, 0, 30}], x] (* Vincenzo Librandi, Jun 17 2013 *)
LinearRecurrence[{12, -21, 10}, {1, 9, 98}, 20] (* Harvey P. Dale, Jul 18 2020 *)
PROG
(Magma) [10^n-n: n in [0..20]]; // Vincenzo Librandi, Jun 30 2011
(Magma) I:=[1, 9, 98]; [n le 3 select I[n] else 12*Self(n-1)-21*Self(n-2)+10*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 17 2013
(PARI) a(n)=10^n-n \\ Charles R Greathouse IV, Oct 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved