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.

Showing 1-1 of 1 results.

A319172 a(n) = 2*(a(n-1) + a(n-3)) - a(n-4), with a(0) = 1, a(1) = 2, a(2) = 5 and a(3) = 12.

Original entry on oeis.org

1, 2, 5, 12, 27, 62, 143, 328, 753, 1730, 3973, 9124, 20955, 48126, 110527, 253840, 582977, 1338882, 3074917, 7061948, 16218683, 37248318, 85545615, 196466648, 451211249, 1036265410, 2379918501, 5465792852, 12552905275, 28829382142
Offset: 0

Views

Author

A.H.M. Smeets, Sep 12 2018

Keywords

Comments

The growth factor for large n (i.e., a(n)/a(n-1)) is (1 + sqrt(3) + sqrt(2*sqrt(3))) = A319129.

Crossrefs

Cf. A319129.

Programs

  • GAP
    a:=[1,2,5,12];; for n in [5..30] do a[n]:=2*(a[n-1]+a[n-3])-a[n-4]; od; a; # Muniru A Asiru, Sep 12 2018
    
  • Magma
    I:=[1,2,5,12]; [n le 4 select I[n] else 2*(Self(n-1) + Self(n-3)) - Self(n-4): n in [1..30]]; // Vincenzo Librandi, Sep 29 2018
  • Maple
    f:= gfun:-rectoproc({a(n) = 2*(a(n-1)+a(n-3))-a(n-4), a(0) = 1, a(1) = 2, a(2) = 5, a(3) = 12},a(n),remember):
    map(f, [$0..40]); # Robert Israel, Sep 12 2018
  • Mathematica
    LinearRecurrence[{2, 0, 2, -1}, {1, 2, 5, 12}, 30] (* Vincenzo Librandi, Sep 29 2018 *)
    CoefficientList[Series[(1 + x^2) / (1 - 2*x - 2*x^3 + x^4), {x, 0, 30}], x] (* Stefano Spezia, Sep 29 2018 *)
  • PARI
    Vec((1 + x^2) / (1 - 2*x - 2*x^3 + x^4) + O(x^40)) \\ Colin Barker, Sep 13 2018
    

Formula

Limit_{n -> inf} a(n)/a(n-1) = (1 + sqrt(3) + sqrt(2*sqrt(3)))/2 = A319129.
G.f.: (1 + x^2) / (1 - 2*x - 2*x^3 + x^4). - Colin Barker, Sep 13 2018
Showing 1-1 of 1 results.