OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (120,-3510,29160,-59049).
FORMULA
G.f.: 1/((1-3*x)*(1-9*x)*(1-27*x)*(1-81*x)).
a(n) = 3^n*(3^(n+1)-1)*(3^(n+2)-1)*(3^(n+3)-1)/416.
a(0)=1, a(1)=120, a(2)=10890, a(3)=914760; for n>3, a(n) = 120*a(n-1) -3510*a(n-2) +29160*a(n-3) -59049*a(n-4).
a(n) -108*a(n-1) +2187*a(n-2) = A016142(n) with a(-1)=a(-2)=0. [Bruno Berselli, Jul 11 2013]
MATHEMATICA
CoefficientList[Series[1 / ((1 - 3 x) (1 - 9 x) (1 - 27 x) (1 - 81 x)), {x, 0, 20}], x]
LinearRecurrence[{120, -3510, 29160, -59049}, {1, 120, 10890, 914760}, 20] (* Harvey P. Dale, Sep 21 2016 *)
PROG
(Magma) m:=25; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-3*x)*(1-9*x)*(1-27*x)*(1-81*x)))); /* or */ I:=[1, 120, 10890, 914760]; [n le 4 select I[n] else 120*Self(n-1)-3510*Self(n-2)+29160*Self(n-3)-59049*Self(n-4): n in [1..25]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Jul 11 2013
STATUS
approved