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.

A101399 a(0) = 1, a(1) = 2, a(2) = 5; for n >= 3, a(n) = a(n-1) + 2*a(n-2) + a(n-3).

Original entry on oeis.org

1, 2, 5, 10, 22, 47, 101, 217, 466, 1001, 2150, 4618, 9919, 21305, 45761, 98290, 211117, 453458, 973982, 2092015, 4493437, 9651449, 20730338, 44526673, 95638798, 205422482, 441226751, 947710513, 2035586497, 4372234274
Offset: 0

Views

Author

Jeroen F.J. Laros, Jan 15 2005

Keywords

Comments

Lengths of successive words (starting with a) under the substitution: {a -> ab, b -> aac, c -> a}.

Crossrefs

Pairwise sums of A078007. Bisection of A003410 and A058278.

Programs

  • GAP
    a:=[1,2,5];; for n in [4..35] do a[n]:=a[n-1]+2*a[n-2]+a[n-3]; od; a; # Muniru A Asiru, Apr 03 2018
  • Magma
    I:=[1,2,5]; [n le 3 select I[n] else Self(n-1) + 2*Self(n-2) + Self(n-3): n in [1..30]]; // G. C. Greubel, Apr 03 2018
    
  • Magma
    m:=25; R:=PowerSeriesRing( Integers(), m); Coefficients(R!((1+x+x^2)/(1-x-2*x^2-x^3))); // G. C. Greubel, Apr 03 2018
    
  • Mathematica
    a[0] = 1; a[1] = 2; a[2] = 5; a[n_] := a[n] = a[n - 1] + 2a[n - 2] + a[n - 3]; Table[ a[n], {n, 0, 30}] (* Robert G. Wilson v, Jan 15 2005 *)
    LinearRecurrence[{1,2,1},{1,2,5},30] (* Harvey P. Dale, Aug 29 2012 *)
    CoefficientList[Series[(1+x+x^2)/(1-x-2*x^2-x^3), {x, 0, 50}], x] (* G. C. Greubel, Apr 03 2018 *)
  • PARI
    x='x+O('x^30); Vec((1+x+x^2)/(1-x-2*x^2-x^3)) \\ G. C. Greubel, Apr 03 2018
    

Formula

G.f.: (1+x+x^2)/(1-x-2*x^2-x^3). - G. C. Greubel, Apr 03 2018

Extensions

More terms from Robert G. Wilson v and Lior Manor, Jan 15 2005