OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: (3*x-2*x^3)/(1-x-x^3+x^4).
a(n) = 1 + a(n-3) for n>2; a(0)=0, a(1)=a(2)=3.
a(n) = (3*n+15+6*cos(2*(n-2)*Pi/3)-8*sqrt(3)*sin(2*(n-2)*Pi/3))/9. - Wesley Ivan Hurt, Oct 01 2017
a(n) = 3*floor((n+2)/3) - 2*floor(n/3). - Ridouane Oudra, Jan 25 2024
EXAMPLE
a(8) = 5:
._._._._._._._._.
| | | |
| | |___|
|_____|_____|_|_| .
MAPLE
a:= n-> iquo(n, 3, 'r') +[0, 3, 3][r+1]:
seq(a(n), n=0..80);
MATHEMATICA
CoefficientList[Series[(3 x - 2 x^3)/(1 - x - x^3 + x^4), {x, 0, 70}], x] (* Michael De Vlieger, Oct 01 2017 *)
PROG
(PARI) concat(0, Vec((3*x-2*x^3)/(1-x-x^3+x^4) + O(x^50))) \\ Felix Fröhlich, Oct 02 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Jun 12 2013
STATUS
approved