OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: x*(1+3*x+2*x^2+2*x^3)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Dec 05 2011
a(n) = 3n - 2 - floor(n/3). - Wesley Ivan Hurt, Nov 07 2013
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (24*n-15-3*cos(2*n*Pi/3)-sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-2, a(3k-1) = 8k-4, a(3k-2) = 8k-7. (End)
E.g.f.: 2 + exp(x)*(8*x - 5)/3 - exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2))/9. - Stefano Spezia, Mar 30 2023
MAPLE
MATHEMATICA
Table[3n-Floor[n/3]-2, {n, 100}] (* Wesley Ivan Hurt, Nov 07 2013 *)
PROG
(Magma) [n : n in [0..150] | n mod 8 in [1, 4, 6]]; // Wesley Ivan Hurt, Jun 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved