cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A052547 Expansion of (1-x)/(1-x-2*x^2+x^3).

Original entry on oeis.org

1, 0, 2, 1, 5, 5, 14, 19, 42, 66, 131, 221, 417, 728, 1341, 2380, 4334, 7753, 14041, 25213, 45542, 81927, 147798, 266110, 479779, 864201, 1557649, 2806272, 5057369, 9112264, 16420730, 29587889, 53317085, 96072133, 173118414, 311945595, 562110290, 1012883066
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Form the graph with matrix A=[0,1,1;1,0,0;1,0,1] (P_3 with a loop at an extremity). Then A052547 counts closed walks of length n at the degree 2 vertex. - Paul Barry, Oct 02 2004
The characteristic polynomial x^3 - x^2 - 2*x + 1 generates a 3 step recursion: a(0)=1,a(1)=0,a(2)=2, for n>2 a(n)=a(n-1)+2*a(n-2)-a(n-3) so we can also prepend the term 1,0 to a(n) and get the same sequence, i.e. start with a(0)=1,a(1)=0,a(2)=1. - Lambert Klasen (lambert.klasen(AT)gmx.net), Jan 30 2005
The length of the diagonals (including the side) of a regular 7-gon (heptagon) inscribed in a circle of radius r=1 are d_1=2*sin(Pi/7) (the side length), d_2=2*cos(Pi/7)*d_1, and d_3=2*sin(3*Pi/7). The two ratios are rho := R_2 = d_2/d_1 = 2*cos(Pi/7) approximately 1.801937736, and sigma:= R_3 = d_3/d_1 = S(2,rho) = rho^2-1, approximately 2.246979604. See A049310 for Chebyshev S-polynomials. See the Steinbach reference where the basis <1,rho,sigma> has been considered for an extension of the rational field Q, which is there called Q(rho). This rho is the largest zero of S(6,x). For nonnegative powers of rho one has rho^n = C(n)*1 + B(n)*rho + A(n)*sigma, with B(n)=a(n-1), a(-1):=0, a(-2):=1, A(n)=B(n+1)-B(n-1)= A006053(n), and C(n)=B(n-1)=a(n-2), n>=0. For negative powers see A106803 and -A006054. For nonnegative and negative powers of sigma see A006054, A106803 and a(n), -A006053, respectively.
a(n) appears also in the formula for the nonpositive powers of sigma (see the comment above for the definition and the Steinbach basis) as sigma^(-n) = a(n)*1 - A006053(n+1)*rho - a(n-1)*sigma, n>=0. Put a(-1):=0. 1/sigma=sigma-rho, the smallest positive zero of S(6,x) (see A049310 for Chebyshev S-polynomials). - Wolfdieter Lang, Dec 01 2010

Crossrefs

Cf. A096976; second differences of A028495 and first differences of A006053 (up to an offset).

Programs

  • GAP
    a:=[1,0,2];; for n in [4..40] do a[n]:=a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, May 08 2019
  • Magma
    I:=[1,0,2]; [n le 3 select I[n] else Self(n-1) + 2*Self(n-2) - Self(n-3): n in [1..40]]; // G. C. Greubel, May 08 2019
    
  • Maple
    spec := [S,{S=Sequence(Prod(Z,Union(Z,Prod(Z, Sequence(Z)))))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..40);
  • Mathematica
    LinearRecurrence[{1, 2, -1}, {1, 0, 2}, 40] (* Vladimir Joseph Stephan Orlovsky, Feb 13 2012 *)
  • PARI
    {a(n) = if(n==0,1,if(n==1,0,if(n==2,2,a(n-1)+2*a(n-2)-a(n-3))))};
    for(i=0,40,print1(a(i),",")) \\ Lambert Klasen, Jan 30 2005
    
  • Sage
    ((1-x)/(1-x-2*x^2+x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 08 2019
    

Formula

a(n) = a(n-1) + 2*a(n-2) - a(n-3), with a(0)=1, a(1)=0, a(2)=2.
a(n) = Sum(-1/7*_alpha*(-3+_alpha)*_alpha^(-1-n), _alpha=RootOf(_Z^3-2*_Z^2-_Z+1)).
a(n) = 5*a(n-2) - 6*a(n-4) + a(n-6). - Floor van Lamoen, Nov 02 2005

Extensions

More terms from James Sellers, Jun 05 2000