OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-5,3,-1).
FORMULA
a(n) = Sum_{i=0..n} A000931(3*i).
a(n) = A000931(3n+2)+1.
From Colin Barker, Nov 09 2019: (Start)
G.f.: (1 - 2*x) / ((1 - x)*(1 - 3*x + 2*x^2 - x^3)).
a(n) = 4*a(n-1) - 5*a(n-2) + 3*a(n-3) - a(n-4) for n>3. (End)
EXAMPLE
For n = 3, a(3) = 1+1+1+2 = 5.
MATHEMATICA
LinearRecurrence[{4, -5, 3, -1}, {1, 2, 3, 5}, 50] (* Paolo Xausa, Apr 08 2024 *)
PROG
(Python)
p = lambda x:[1, 0, 0][x] if x<3 else p(x-2)+p(x-3)
a = lambda x:sum(p(3*i) for i in range(x+1))
(PARI) Vec((1 - 2*x) / ((1 - x)*(1 - 3*x + 2*x^2 - x^3)) + O(x^35)) \\ Colin Barker, Nov 09 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Nov 09 2019
STATUS
approved