OFFSET
0,4
COMMENTS
Difference table for a(n):
0, 1, 1, 3, 5, 8, 12, 19, 31, 51, 83, 134, 216, ...
1, 0, 2, 2, 3, 4, 7, 12, 20, 32, 51, 82, 133, ...
-1, 2, 0, 1, 1, 3, 5, 8, 12, 19, 31, 51, 83, ...
3, -2, 1, 0, 2, 2, 3, 4, 7, 12, 20, 32, 51, ...
etc.
The pair a(n) = 0, 1, 1, 3, 5, 8, 12, 19, 31, 51, ...
and b(n) = 0, 2, 2, 3, 4, 7, 12, 20, 32, 51, ...
is interesting. a(n) and b(n) are autosequences of the first kind (see Link). a(n) and b(n) have the same first trisection: 3*A001076(n).
b(n) - a(n) = 0, 1, 1, 0, -1, -1, 0, ... = A128834(n).
a(n+6) - a(n) = b(n+6) - b(n) = 6*Fib(n+3).
a(n) - a(n) mod 9 = 9*A004699(n) = b(n) - b(n) mod 9.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
OEIS Wiki, Autosequence
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1).
FORMULA
a(n) = 2*a(n-1) - a(n-2) + a(n-4). Valid for b(n).
G.f.: x*(1 - x + 2*x^2) / ((1 - x + x^2)*(1 - x - x^2)). - Colin Barker, May 06 2017
MATHEMATICA
LinearRecurrence[{2, -1, 0, 1}, {0, 1, 1, 3}, 40] (* or *)
CoefficientList[Series[x (1 - x + 2 x^2)/((1 - x + x^2) (1 - x - x^2)), {x, 0, 39}], x] (* Michael De Vlieger, May 07 2017 *)
PROG
(PARI) concat(0, Vec(x*(1 - x + 2*x^2) / ((1 - x + x^2)*(1 - x - x^2)) + O(x^60))) \\ Colin Barker, May 06 2017
(Magma) I:=[0, 1, 1, 3]; [n le 4 select I[n] else 2*Self(n-1) - Self(n-2) + Self(n-4): n in [1..30]]; // G. C. Greubel, Jan 15 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, May 06 2017
EXTENSIONS
More terms from Colin Barker, May 06 2017
STATUS
approved