OFFSET
0,3
REFERENCES
R. Pallu de la Barriere, Optimal Control Theory, Dover Publications, New York, 1967, pages 339-344
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,0,-1).
FORMULA
G.f.: x*(1 + 2*x - x^2)/((1-x)*(1 - x^2 - x^3)). [Dec 03 2009]
a(n) = a(n-2) + a(n-3) + 2. - Greg Dresden, May 18 2020
MATHEMATICA
LinearRecurrence[{1, 1, 0, -1}, {0, 1, 3, 3}, 50] (* or *) CoefficientList[ Series[ x*(-1-2x+x^2)/((1-x)(x^3+x^2-1)), {x, 0, 50}], x] (* Harvey P. Dale, Jun 22 2011 *)
PROG
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; -1, 0, 1, 1]^n*[0; 1; 3; 3])[1, 1] \\ Charles R Greathouse IV, Jul 29 2016
(Magma)
R<x>:=PowerSeriesRing(Integers(), 60);
[0] cat Coefficients(R!( x*(1+2*x-x^2)/((1-x)*(1-x^2-x^3)) )); // G. C. Greubel, Apr 20 2025
(SageMath)
def A168637_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x*(1+2*x-x^2)/((1-x)*(1-x^2-x^3)) ).list()
print(A168637_list(60)) # G. C. Greubel, Apr 20 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula and Gary W. Adamson, Dec 01 2009
EXTENSIONS
Precise definition and more formulas supplied by the Assoc. Editors of the OEIS, Dec 03 2009
STATUS
approved
