OFFSET
0,5
REFERENCES
Martin Gardner, Mathematical Circus, Random House, New York, 1981, p. 165.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,-2,1).
FORMULA
From R. J. Mathar, Aug 25 2008: (Start)
O.g.f.: -(1-x+x^2)/(1-x+2*x^2-x^3).
a(n) = A078019(n-2), n > 0. (End)
a(n) = -A000931(-2*n + 3). - Michael Somos, Sep 18 2012
EXAMPLE
G.f. = -1 + x^2 - 2*x^4 - x^5 + 3*x^6 + 3*x^7 - 4*x^8 - 7*x^9 + ...
MATHEMATICA
Nest[Append[#, #[[-1]] - 2 #[[-2]] + #[[-3]]] &, {-1, 0, 1}, 44] (* Michael De Vlieger, Dec 17 2017 *)
LinearRecurrence[{1, -2, 1}, {-1, 0, 1}, 50] (* Harvey P. Dale, Feb 06 2024 *)
PROG
(MATLAB)
function y=fib(n)
%Generates difference sequence
fz(1)=-1; fz(2)=0; fz(3)=1;
for k=4:n
fz(k)=fz(k-1)-2*fz(k-2)+fz(k-3);
end
y=fz(n);
(PARI) x='x+O('x^99); Vec((1-x+x^2)/(-1+x-2*x^2+x^3)) \\ Altug Alkan, Dec 17 2017
(Magma)
I:=[-1, 0, 1]; [n le 3 select I[n] else Self(n-1) -2*Self(n-2) +Self(n-3): n in [1..50]]; // G. C. Greubel, Sep 16 2024
(SageMath)
def A141576_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( -(1-x+x^2)/(1-x+2*x^2-x^3) ).list()
A141576_list(50) # G. C. Greubel, Sep 16 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Matt Wynne (mattwyn(AT)verizon.net), Aug 18 2008
EXTENSIONS
Extended by R. J. Mathar, Aug 25 2008
STATUS
approved