A052533 Expansion of (1-x)/(1-x-3*x^2).
1, 0, 3, 3, 12, 21, 57, 120, 291, 651, 1524, 3477, 8049, 18480, 42627, 98067, 225948, 520149, 1197993, 2758440, 6352419, 14627739, 33684996, 77568213, 178623201, 411327840, 947197443, 2181180963, 5022773292, 11566316181, 26634636057
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 463
- Index entries for linear recurrences with constant coefficients, signature (1,3).
Programs
-
GAP
a:=[1,0];; for n in [3..40] do a[n]:=a[n-1]+3*a[n-2]; od; a; # G. C. Greubel, May 09 2019
-
Magma
I:=[1,0]; [n le 2 select I[n] else Self(n-1)+3*Self(n-2): n in [1..40]]; // G. C. Greubel, May 09 2019
-
Magma
R
:=PowerSeriesRing(Integers(), 33); Coefficients(R!( (1-x)/(1-x-3*x^2))); // Marius A. Burtea, Jan 15 2020 -
Maple
spec := [S,{S=Sequence(Prod(Z,Union(Z,Z,Z),Sequence(Z)))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20); seq(coeff(series((1-x)/(1-x-3*x^2), x, n+1), x, n), n = 0..40); # G. C. Greubel, Jan 15 2020
-
Mathematica
CoefficientList[Series[(1-x)/(1-x-3x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Oct 07 2013 *) LinearRecurrence[{1,3}, {1,0}, 40] (* G. C. Greubel, May 09 2019 *)
-
PARI
my(x='x+O('x^30)); Vec((1-x)/(1-x-3*x^2)) \\ G. C. Greubel, May 09 2019
-
Sage
[lucas_number1(n+1,1,-3) -lucas_number1(n,1,-3) for n in (0..40)] # G. C. Greubel, May 09 2019
Formula
G.f.: (1 - x)/(1 - x - 3*x^2).
a(n) = a(n-1) + 3*a(n-2), with a(0)=1, a(1)=0.
a(n) = Sum_{alpha = RootOf(-1+x+3*x^2)} (1/13)*(-1 + 7*alpha)* alpha^(-n-1).
a(n) = Sum_{k=0..floor(n/2)} C(n-k-1,n-2*k)*3^k. - Paul Barry, Mar 16 2010
If p[1]=0, and p[i]=3, (i>1), and if A is Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n>=1, a(n)=det A. - Milan Janjic, Apr 29 2010
G.f.: (Q(0) -1)*(1-x)/x, where Q(k) = 1 + 3*x^2 + (k+2)*x - x*(k+1 + 3*x)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 07 2013
a(n) = 3^(n/2) * Fibonacci(n-1, 1/sqrt(3)). - G. C. Greubel, Jan 15 2020
From Wolfdieter Lang, Nov 27 2023: (Start)
a(n) = 3*sqrt(-3)^(n-2)*S(n-2, 1/sqrt(-3)), with the S Chebyshev polynomials (see A049310), valid also for negative indices n, using S(-n, x) = - S(n-2, x), for n>= 2, and S(-1, x) = 0. (End)
Extensions
More terms from James Sellers, Jun 06 2000
Comments