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.

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

Original entry on oeis.org

1, 1, 3, 8, 20, 51, 130, 331, 843, 2147, 5468, 13926, 35467, 90328, 230049, 585893, 1492163, 3800268, 9678592, 24649615, 62778090, 159884387, 407196479, 1037055435, 2641191736, 6726635386, 17131517943, 43630863008, 111119879345, 283002139641, 720755021635
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Number of compositions of n where there is one sort of part 1, two sorts of part 2, and three sorts of every other part. - Joerg Arndt, Mar 15 2014
Number of ways to tile a strip of length n with red and blue squares, blue dominos, and blue trominos, where the first tile must be blue. - Greg Dresden and Arnim Kuchhal, Aug 05 2024

Programs

  • GAP
    a:=[1,1,3];; for n in [4..30] do a[n]:=2*a[n-1]+a[n-2]+a[n-3]; od; a; # G. C. Greubel, Jun 27 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)/( 1-2*x-x^2-x^3) )); // G. C. Greubel, Jun 27 2019
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-2x-x^2-x^3),{x,0,30}],x] (* or *) LinearRecurrence[{2,1,1},{1,1,3},30] (* Harvey P. Dale, May 24 2011 *)
  • Maxima
    a(n):=sum(sum(binomial(m+i-1,m-1) * sum(binomial(j,n-3*m+2*j-i) * binomial(m,j),j,0,m), i,0,n-m), m,1,n); /* Vladimir Kruchinin, May 12 2011 */
    
  • PARI
    Vec((1-x)/(1-2*x-x^2-x^3)+O(x^30)) \\ Charles R Greathouse IV, Sep 26 2012
    
  • Sage
    ((1-x)/(1-2*x-x^2-x^3)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jun 27 2019
    

Formula

a(n) = 2*a(n-1) + a(n-2) + a(n-3), n>2, with a(0)=1, a(1)=1, a(2)=3. - Philippe Deléham, Nov 20 2008
If p[1]=1, p[2]=2, p[i]=3, (i>2), 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, May 02 2010
a(n) = Sum_{m=1..n} Sum_{i=0..n-m} binomial(m+i-1,m-1)*Sum_{j=0..m} binomial(j,n-3*m+2*j-i)*binomial(m,j), n>0, a(0)=1. - Vladimir Kruchinin, May 12 2011

Extensions

Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021