OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (21,-143,315).
FORMULA
a(n) = (5^(n+2) - 2*7^(n+2) + 9^(n+2))/8. - R. J. Mathar, Jun 29 2013
a(0)=1, a(1)=21, a(2)=298; for n>2, a(n) = 21*a(n-1) -143*a(n-2) +315*a(n-3). - Vincenzo Librandi, Jul 03 2013
a(n) = 16*a(n-1) -63*a(n-2) +5^n. - Vincenzo Librandi, Jul 03 2013
E.g.f.: (25*exp(5*x) - 98*exp(7*x) + 81*exp(9*x))/8. - G. C. Greubel, Nov 24 2018
MAPLE
a:= n-> (Matrix(3, (i, j)-> `if`(i=j-1, 1, `if`(j=1, [21, -143, 315][i], 0)))^n)[1, 1]: seq(a(n), n=0..25); # Alois P. Heinz, Jul 03 2013
MATHEMATICA
CoefficientList[Series[1/((1-5x)(1-7x)(1-9 x)), {x, 0, 20}], x] (* Vincenzo Librandi, Jul 03 2013 *)
LinearRecurrence[{21, -143, 315}, {1, 21, 298}, 20] (* or *) Table[(5^(n+2) - 2*7^(n+2) + 9^(n+2))/8, {n, 0, 20}] (* G. C. Greubel, Nov 24 2018 *)
PROG
(Magma) m:=20; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-5*x)*(1-7*x)*(1-9*x)))); /* or */ I:=[1, 21, 298]; [n le 3 select I[n] else 21*Self(n-1)-143*Self(n-2)+315*Self(n-3): n in [1..20]]; // Vincenzo Librandi, Jul 03 2013
(Magma) [(5^(n+2) - 2*7^(n+2) + 9^(n+2))/8: n in [0..20]]; // G. C. Greubel, Nov 24 2018
(PARI) vector(20, n, n--; (5^(n+2) - 2*7^(n+2) + 9^(n+2))/8) \\ G. C. Greubel, Nov 24 2018
(Sage) [(5^(n+2) - 2*7^(n+2) + 9^(n+2))/8 for n in range(20)] # G. C. Greubel, Nov 24 2018
(GAP) List([0..20], n -> (5^(n+2) - 2*7^(n+2) + 9^(n+2))/8); # G. C. Greubel, Nov 24 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved