OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..500
Index entries for linear recurrences with constant coefficients, signature (3,0,-3,1).
FORMULA
G.f.: (1-2*x-x^2+x^3) / ( (1-x)*(1+x)*(1-3*x+x^2) ).
a(n) = Fibonacci(2*floor(n/2) + 1)*Fibonacci(2*floor((n-1)/2) + 1).
a(n) = Fibonacci(n)^2 * (1-(-1)^n)/2 + Fibonacci(n-1)*Fibonacci(n+1) * (1+(-1)^n)/2.
a(n+1)*a(n+3) - a(n+2)^2 = Fibonacci(n+2)^2 * (1-(-1)^n)/2.
a(n) = 3*a(n-1) - 3*a(n-3) + a(n-4). - G. C. Greubel, May 15 2016
MATHEMATICA
CoefficientList[Series[(1-2x-x^2+x^3)/((1-x)(1+x)(1-3x+x^2)), {x, 0, 30}], x] (* Harvey P. Dale, Dec 26 2013 *)
(* Alternative: *)
LinearRecurrence[{3, 0, -3, 1}, {1, 1, 2, 4}, 30] (* Harvey P. Dale, Dec 26 2013 *)
PROG
(Magma)
A166516:= func< n | (n mod 2)*Fibonacci(n)^2 +((n+1) mod 2)*Fibonacci(n-1)*Fibonacci(n+1) >;
[A166516(n): n in [0..40]]; // G. C. Greubel, Aug 03 2024
(SageMath)
f=fibonacci
def A166516(n): return (n%2)*f(n)^2 +((n+1)%2)*f(n-1)*f(n+1)
[A166516(n) for n in range(41)] # G. C. Greubel, Aug 03 2024
(Python)
from gmpy2 import fib2
def A166516(n):
b, a = fib2(n+1&-2)
return a*(a if n&1 else a+b) # Chai Wah Wu, Jul 14 2026
CROSSREFS
KEYWORD
easy,nonn,changed
AUTHOR
Paul Barry, Oct 16 2009
STATUS
approved
