OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (4,0,-1).
FORMULA
a(n) = 4*a(n-1) - a(n-3) for n>3.
G.f.: (1-x)/(1-4*x+x^3).
G.f.: 1/(x - x^2*Sum_{n>=0} A030186(n)*x^n) - 1/x.
MAPLE
seq(coeff(series((1-x)/(1-4*x+x^3), x, n+1), x, n), n = 0..30); # G. C. Greubel, Oct 26 2019
MATHEMATICA
LinearRecurrence[{4, 0, -1}, {1, 3, 12}, 30] (* or *) CoefficientList[Series[ (1-x)/(1-4x+x^3), {x, 0, 30}], x] (* Harvey P. Dale, Jun 24 2011 *)
PROG
(PARI) {a(n)=if(n==0, 1, if(n==1, 3, (sum(k=0, n-1, a(k))^2 + 2*sum(k=0, n-1, a(k)^2))/a(n-1)))}
for(n=0, 20, print1(a(n), ", ")) \\ Paul D. Hanna, Feb 20 2014
(PARI) Vec( (1-x)/(1-4*x+x^3) + O(x^66) ) \\ Joerg Arndt, Feb 16 2014
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)/(1-4*x+x^3) )); // G. C. Greubel, Oct 26 2019
(Sage)
def A088132_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1-x)/(1-4*x+x^3)).list()
A088132_list(30) # G. C. Greubel, Oct 26 2019
(GAP) a:=[1, 3, 12];; for n in [4..30] do a[n]:=34a[n-1]-a[n-3]; od; a; # G. C. Greubel, Oct 26 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul D. Hanna, Sep 19 2003
STATUS
approved