OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..175
Index entries for linear recurrences with constant coefficients, signature (3,3,4).
FORMULA
G.f.: x*(4+5*x)/(1 - 3*x - 3*x^2 - 4*x^3).
a(n) = 4^n-A057078(n) = 4^n - (n-th element of periodic length 3 repeat 1, 0, -1)
a(n+1) = 4*a(n) + (n-th element of periodic length 3 repeat 4, 1, -5).
a(0)=0, a(1)=4, a(2)=17, a(n) = 3*a(n-1) + 3*a(n-2) + 4*a(n-3). - Harvey P. Dale, Jun 19 2011
a(n) = 4*a(n-1) + a(n-3) - 4*(n-4) (n>3). - Bruno Berselli, Jul 04 2011
MATHEMATICA
LinearRecurrence[{3, 3, 4}, {0, 4, 17}, 30] (* or *) CoefficientList[ Series[ x (4+5x)/((1-4x)(1+x+x^2)), {x, 0, 30}], x] (* Harvey P. Dale, Jun 19 2011 *)
PROG
(PARI) a(n)=4^n-[1, 0, -1][n%3+1] \\ Charles R Greathouse IV, Jun 06 2011
(Magma) m:=24; R<x>:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!(x*(4+5*x)/((1-4*x)*(1+x+x^2)))); // Bruno Berselli, Jul 04 2011
(Maxima) makelist(coeff(taylor(x*(4+5*x)/((1-4*x)*(1+x+x^2)), x, 0, n), x, n), n, 0, 23); /* Bruno Berselli, Jun 06 2011 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, May 29 2011
STATUS
approved