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