OFFSET
0,1
REFERENCES
S. Ramanujan, Note on a set of Simultaneous Equations, J. Indian Math. Soc., 4(1912), 94-96.
LINKS
S. Ramanujan, Note on a set of Simultaneous Equations, J. Indian Math. Soc., 4(1912), 94-96.
Index entries for linear recurrences with constant coefficients, signature (1,5,-1,-3,1).
FORMULA
G.f.: (2 + x + 3*x^2 + 2*x^3 + x^4)/(1 - x - 5*x^2 + x^3 + 3*x^4 - x^5).
a(n) = 2*a(n-1) + 3*a(n-2) - 4*a(n-3) + a(n-4) + 3*(-1)^n for all n in Z.
a(n) = (-3/5)*(-1)^n + (-9/2)*F(-n) - F(-n-1) + (13/10)*F(2*n-1) + (23/10)*F(2*n+1) for all n in Z. - Michael Somos, Apr 10 2022
EXAMPLE
G.f. = 2 + 3*x + 16*x^2 + 31*x^3 + 103*x^4 + 235*x^5 + 674*x^6 + 1669*x^7 + 4526*x^8 + ...
MATHEMATICA
CoefficientList[Series[(2+x+3x^2+2x^3+x^4)/(1-x-5x^2+x^3+3x^4-x^5), {x, 0, 40}], x] (* or *) LinearRecurrence[{1, 5, -1, -3, 1}, {2, 3, 16, 31, 103}, 40] (* Harvey P. Dale, Sep 23 2018 *)
a[ n_] := Module[{F = Fibonacci}, (-3/5)*(-1)^n + (-9/2)*F[-n] - F[-n-1] + (13/10)*F[2*n-1] + (23/10)*F[2*n+1] ]; (* Michael Somos, Apr 10 2022 *)
PROG
(PARI) {a(n) = if( n<0, 0, polcoeff( (2 + x + 3*x^2 + 2*x^3 + x^4) / (1 - x - 5*x^2 + x^3 + 3*x^4 - x^5) + x * O(x^n), n))};
(PARI) {a(n) = my(F = fibonacci); (-3/5)*(-1)^n + (-9/2)*F(-n) - F(-n-1) + (13/10)*F(2*n-1) + (23/10)*F(2*n+1) }; /* Michael Somos, Apr 10 2022 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Jul 01 2002
STATUS
approved