OFFSET
0,4
COMMENTS
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,4,-1,-1)
FORMULA
Let F(n) be the Fibonacci number A000045(n).
a(n) = Sum_{k = 1..n} (-1)^k F(k)^2.
Closed form: a(n) = (-1)^n F(2n+1)/5 - (2 n + 1)/5.
Recurrence: a(n) + a(n-1) - 4 a(n-2) + a(n-3) + a(n-4) = 0.
G.f.: A(x) = (-x - x^2)/(1 + x - 4 x^2 + x^3 + x^4) = -x(1 + x)/((1 - x)^2 (1 + 3 x + x^2)).
a(n) = (2^(-1-n)*(-5*2^(1+n)+5*(-3+sqrt(5))^n - sqrt(5)*(-3+sqrt(5))^n + (-3-sqrt(5))^n*(5+sqrt(5)) - 5*2^(2+n)*n)) / 25. - Colin Barker, Apr 25 2017
EXAMPLE
The first few squares of Fibonacci numbers are: 0, 1, 1, 4, 9, 25, 64, 169.
a(0) = 0.
a(1) = 0 - 1 = -1.
a(2) = 0 - 1 + 1 = 0.
a(3) = 0 - 1 + 1 - 4 = -4.
a(4) = 0 - 1 + 1 - 4 + 9 = 5.
MATHEMATICA
altFiboSqSum[n_Integer] := If[n >= 0, Sum[(-1)^k Fibonacci[k]^2, {k, n}], Sum[-(-1)^k Fibonacci[-k]^2, {k, 1, -n - 1}]]; altFiboSqSum[Range[0, 39]] (* Clary *)
Accumulate[Table[(-1)^n Fibonacci[n]^2, {n, 0, 39}]] (* Alonso del Arte, Apr 25 2017 *)
Accumulate[Times@@@Partition[Riffle[Fibonacci[Range[0, 40]]^2, {1, -1}, {2, -1, 2}], 2]] (* Harvey P. Dale, Jul 29 2024 *)
PROG
(PARI) concat(0, Vec(-x*(1 + x) / ((1 - x)^2*(1 + 3*x + x^2)) + O(x^40))) \\ Colin Barker, Apr 25 2017
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Stuart Clary, May 13 2006
STATUS
approved