login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
1
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,2
COMMENTS
The growth factor for large n (i.e., a(n)/a(n-1)) is (1 + sqrt(3) + sqrt(2*sqrt(3))) = A319129.
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
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 *)
PROG
(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
(PARI) Vec((1 + x^2) / (1 - 2*x - 2*x^3 + x^4) + O(x^40)) \\ Colin Barker, Sep 13 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
CROSSREFS
Cf. A319129.
Sequence in context: A190171 A091596 A077863 * A018009 A128096 A018010
KEYWORD
nonn,easy,changed
AUTHOR
A.H.M. Smeets, Sep 12 2018
STATUS
approved