OFFSET
0,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000 [Terms 0 through 500 were computed by G. C. Greubel]
Index entries for linear recurrences with constant coefficients, signature (0,1,0,0,3).
FORMULA
a(0)=1, a(1)=1, a(2)=1, a(3)=1, a(4)=1; a(n) = 3*a(n-5)+a(n-2) for n>4.
a(2n) = Sum_{j=0..n/5} binomial(n-3j,2j)*3^(2j) + Sum_{j=0..(n-3)/5} binomial(n-2-3j,2j+1)*3^(2j+1).
a(2n+1) = Sum_{j=0..n/5} binomial(n-3j,2j)*3^{2j} + Sum_{j=0..(n-2)/5} binomial(n-1-3j,2j+1)*3^(2j+1).
EXAMPLE
a(5) = 3*a(0)+a(3)=4; a(6) = 3*a(1)+a(4)=4; a(7) = 3*a(2)+a(5)=7.
MATHEMATICA
For[j = 0, j < 5, j++, a[j] = 1]; For[j = 5, j < 51, j++, a[j] = 3 a[j - 5] + a[j - 2]]; Table[a[j], {j, 0, 50}]
CoefficientList[Series[(1 + x)/(1 - x^2 - 3 x^5), {x, 0, 50}], x] (* Michael De Vlieger, Jan 27 2016 *)
PROG
(PARI) Vec((1+x)/(1-x^2-3*x^5) + O(x^50)) \\ Michel Marcus, Jan 27 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sergio Falcon, Feb 26 2014
STATUS
approved