OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,3,1,-3,1).
FORMULA
G.f.: 1/(- x^m + 1 - x^(1 + m) + x + 3*x^(2 + m) - 2*x^2 - x^(3 + m)) for m=2.
G.f.: 1 / ((1 - x) * (1 + x - x^2)^2). - Michael Somos, Mar 11 2014
a(n) = A006478(-2-n) for all n in Z. - Michael Somos, Mar 11 2014
a(n) = 1 + (-1)^n*(n*Lucas(n+1) + 7*Fibonacci(n))/5. - G. C. Greubel, Dec 04 2019
E.g.f.: exp(-x/2)*(25*exp(3*x/2) - 15*x*cosh(sqrt(5)*x/2) + sqrt(5)*(5*x - 14)*sinh(sqrt(5)*x/2))/25. - Stefano Spezia, Jul 24 2022
EXAMPLE
G.f. = 1 - x + 4*x^2 - 6*x^3 + 14*x^4 - 24*x^5 + 47*x^6 - 83*x^7 + 152*x^8 + ...
MAPLE
with(combinat); seq( 1 + (-1)^n*(n*fibonacci(n+2) + (n+7)*fibonacci(n))/5, n=0..40); # G. C. Greubel, Dec 04 2019
MATHEMATICA
f[x_, m_] = ExpandAll[(x -x^(m+1))*(1-x-x^2) -(1 -2*x +x^(m+1))];
g[x_, n_] = ExpandAll[x^(m + 3)*f[1/x, m]];
a = Table[Table[SeriesCoefficient[Series[1/g[x, m], {x, 0, 20}], n], {n, 0, 20}], {m, 1, 20}]
CoefficientList[Series[1/((1-x)(1+x-x^2)^2), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 13 2014 *)
RecurrenceTable[{a[0]==1, a[1]==-1, a[n]==-a[n-1]+a[n-2]-Fibonacci[-n]+1}, a, {n, 40}] (* Harvey P. Dale, May 12 2018 *)
Table[1 + (-1)^n*(n*LucasL[n+1] + 7*Fibonacci[n])/5, {n, 0, 40}] (* G. C. Greubel, Dec 04 2019 *)
PROG
(PARI) {a(n) = if( n<0, polcoeff( x^5 / ((1 - x) * (1 - x - x^2)^2) + x * O(x^-n), -n), polcoeff( 1 / ((1 - x) * (1 + x - x^2)^2) + x * O(x^n), n))}; /* Michael Somos, Mar 11 2014 */
(PARI) vector(41, n, my(f=fibonacci); 1 -(-1)^n*((n-1)*f(n+1) +(n+6)*f(n-1))/5 ) \\ G. C. Greubel, Dec 04 2019
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-x)*(1+x-x^2)^2))); // G. C. Greubel, Aug 14 2018
(Sage) [1 + (-1)^n*(n*lucas_number2(n+1, 1, -1) + 7*fibonacci(n))/5 for n in (0..40)] # G. C. Greubel, Dec 04 2019
(GAP) List([0..40], n-> 1 + (-1)^n*(n*Lucas(1, -1, n+1)[2] + 7*Fibonacci(n))/5 ); # G. C. Greubel, Dec 04 2019
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula, Dec 04 2010
STATUS
approved