OFFSET
1,2
COMMENTS
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: x*(1+x)*(2x^2+x+1)/((-1+x)^2*(x^2+x+1)). a(n) = a(n-3)+8 for n>3. - R. J. Mathar, Apr 14 2008
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = 2*(12*n-9+sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-2, a(3k-1) = 8k-5, a(3k-2) = 8k-7. (End)
MAPLE
A047400:=n->2*(12*n-9+sqrt(3)*sin(2*n*Pi/3))/9: seq(A047400(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
MATHEMATICA
Select[Range[0, 150], MemberQ[{1, 3, 6}, Mod[#, 8]] &] (* Wesley Ivan Hurt, Jun 10 2016 *)
PROG
(PARI) a(n) = {x=8*floor((n-1)/3); if(n%3==1, x=x+1); if(n%3==2, x=x+3); if(n%3==0, x=x+6); x} \\ Michael B. Porter, Oct 02 2009
(Magma) [n: n in [1..300] | n mod 8 in [1, 3, 6]]; // Vincenzo Librandi, Mar 27 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved