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.

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

Original entry on oeis.org

1, 2, 6, 14, 36, 88, 220, 544, 1352, 3352, 8320, 20640, 51216, 127072, 315296, 782304, 1941056, 4816128, 11949760, 29649664, 73566592, 182532992, 452899840, 1123732480, 2788198656, 6918062592, 17165057536, 42589842944, 105673675776, 262196922368
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Form the graph with matrix A = [1,1,1,1; 1,0,0,0; 1,0,0,0; 1,0,0,1]. Then the sequence 0, 1, 2, 6, ... counts walks of length n between the degree 5 vertex and the degree 3 vertex. - Paul Barry, Oct 02 2004
From Sean A. Irvine, Jun 05 2025: (Start)
Also, the number of walks of length n starting at vertex 0 in the graph:
1-2
/| |
0 | |
\| |
4-3. (End)

Crossrefs

Programs

  • Magma
    [n le 3 select Factorial(n) else 2*(Self(n-1) +Self(n-2) -Self(n-3)): n in [1..51]]; // G. C. Greubel, May 02 2022
    
  • Mathematica
    LinearRecurrence[{2,2,-2}, {1,2,6}, 50] (* Vladimir Joseph Stephan Orlovsky, Jul 03 2011 *)
    CoefficientList[Series[1/(1-2*x-2*x^2+2*x^3),{x,0,40}],x] (* Harvey P. Dale, Dec 05 2018 *)
  • PARI
    Vec(1/(1-2*x-2*x^2+2*x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
    
  • SageMath
    def A077937_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( 1/(1-2*x-2*x^2+2*x^3) ).list()
    A077937_list(50) # G. C. Greubel, May 02 2022

Formula

a(n) = 2*a(n-1) + 2*a(n-2) - 2*a(n-3) with a(0) = 1, a(1) = 2, and a(3) = 8. - G. C. Greubel, May 02 2022