OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 1060
Index entries for linear recurrences with constant coefficients, signature (4,-1,-2).
FORMULA
G.f.: (1-2*x)/(1-4*x+x^2+2*x^3).
Recurrence: {a(0)=1, a(1)=2, -2*a(n)-3*a(n+1)+a(n+2)+1=0}.
a(n) = Sum(-1/136*(-13-27*r+6*r^2)*r^(-1-n) where r=RootOf(1-4*_Z+_Z^2+2*_Z^3)).
a(n) = (1/4+(2^(-3-n)*((3-sqrt(17))^n*(-5+3*sqrt(17))+(3+sqrt(17))^n*(5+3*sqrt(17))))/sqrt(17)). - Colin Barker, Sep 02 2016
a(n)-a(n-1) = A007483(n-1). - R. J. Mathar, Jan 09 2025
MAPLE
spec := [S, {S=Sequence(Union(Prod(Union(Sequence(Union(Z, Z)), Z), Z), Z))}, unlabeled ]: seq(combstruct[count ](spec, size=n), n=0..20);
MATHEMATICA
Join[{a=1, b=2}, Table[c=3*b+2*a-1; a=b; b=c, {n, 100}]] (* Vladimir Joseph Stephan Orlovsky, Jan 17 2011*)
LinearRecurrence[{4, -1, -2}, {1, 2, 7}, 40] (* Vincenzo Librandi, Jun 23 2012 *)
PROG
(Magma) I:=[1, 2, 7]; [n le 3 select I[n] else 4*Self(n-1)-Self(n-2)-2*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 23 2012
(PARI) a(n) = round((1/4+(2^(-3-n)*((3-sqrt(17))^n*(-5+3*sqrt(17))+(3+sqrt(17))^n*(5+3*sqrt(17))))/sqrt(17))) \\ Colin Barker, Sep 02 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
EXTENSIONS
More terms from James A. Sellers, Jun 06 2000
STATUS
approved