OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: x*(1+x+2*x^2+4*x^3)/((1-x)^2*(1+x+x^2)). [Colin Barker, May 14 2012]
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. - Vincenzo Librandi, May 16 2012
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = 8*n/3-3-cos(2*n*Pi/3)+5*sin(2*n*Pi/3)/(3*sqrt(3)).
a(3k) = 8k-4, a(3k-1) = 8k-6, a(3k-2) = 8k-7. (End)
MAPLE
A047465:=n->8*n/3-3-cos(2*n*Pi/3)+5*sin(2*n*Pi/3)/(3*sqrt(3)): seq(A047465(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
MATHEMATICA
Select[Range[0, 300], MemberQ[{1, 2, 4}, Mod[#, 8]]&] (* Vincenzo Librandi, May 16 2012 *)
PROG
(Magma) I:=[1, 2, 4, 9]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // Vincenzo Librandi, May 16 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved