OFFSET
0,3
COMMENTS
Sequences of the form a(0)=1, a(1)=b,
a(n) = a(n-1) + a(n-2) + 1 if n mod 3 =2, else
a(n) = a(n-1) + a(n-2) have a closed form of
a(n) = F(n-1)*a + F(n)*b + floor(F(n+1)/2),
We can generalize the definition of this sequence by changing the added 1 to any value of k and changing the last term of the formula to floor(F(n+1)/2)*k.
Two variants: if we add the constant at n mod 3 = 0, then a(n)=F(n-1)*a + F(n)*b + floor(F(n)/2), and if for n mod 3 =1, then a(n)=F(n-1)*a + F(n)*b + floor(F(n-1)/2).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..280
Index entries for linear recurrences with constant coefficients, signature (1,1,1,-1,-1).
FORMULA
a(0)= 0, a(1)=1, a(n)=a(n-1)+a(n-2)+1 if n mod 3 =2, else a(n)=a(n-1)+a(n-2).
G.f.: x*(1+x-x^3)/[(1-x-x^2)*(1-x^3)].
a(n) = a(n-1) +a(n-2) +(1+(-1)^Fib(n+1))/2.
a(n) = Fibonacci(n) + floor(Fibonacci(n+1)/2). - Gary Detlefs, Dec 10 2010
EXAMPLE
a(5) = a(4) + a(3) + 1 = 5 +3 +1 =9 because 5 mod 3 = 2.
a(6) = a(5) + a(4) = 9 +5 =14 because 6 mod 3 <>2.
MAPLE
with(combinat):
g:=(a, b, n)->fibonacci(n-1)*a+fibonacci(n)*b + floor(fibonacci(n+1)/2):
seq(g(0, 1, n), n=0..30)
MATHEMATICA
Table[Floor[LucasL[n + 1]/2], {n, 0, 50}] (* G. C. Greubel, Nov 24 2016 *)
PROG
(Magma) [Floor(Lucas(n+1)/2): n in [0..50]]; // Vincenzo Librandi, Apr 24 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary Detlefs, Nov 25 2010
STATUS
approved