login
A142880
a(n) = 7*a(n-3) - a(n-6).
0
0, 1, 2, 3, 8, 13, 21, 55, 89, 144, 377, 610, 987, 2584, 4181, 6765, 17711, 28657, 46368, 121393, 196418, 317811, 832040, 1346269, 2178309, 5702887, 9227465, 14930352, 39088169, 63245986, 102334155, 267914296, 433494437, 701408733, 1836311903
OFFSET
0,3
FORMULA
G.f.: -x*(1+x)*(x^3 - 2*x^2 - x - 1) / ( 1 - 7*x^3 + x^6 ).
a(3n) = A033888(n).
a(3n+1) = A033890(n).
a(3n+2)= A033891(n).
a(n) = 2*a(n-1) + a(n-2) if n == 1 (mod 3).
a(n) = a(n-1) + a(n-2) if n == 0 (mod 3).
a(n) = 2*a(n-1) - a(n-2) if n == 2 (mod 3).
MATHEMATICA
a[0] = 0; a[1] = 1;
a[n_] := a[n] = If[Mod[n, 3] == 1, 2*a[n - 1] + a[n - 2], If[Mod[n, 3] == 0, a[n - 1] + a[n - 2], 2*a[n - 1] - a[n - 2]]];
Table[a[n], {n, 0, 50}]
LinearRecurrence[{0, 0, 7, 0, 0, -1}, {0, 1, 2, 3, 8, 13}, 40] (* Harvey P. Dale, Jul 17 2021 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved