OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..3000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
From Wesley Ivan Hurt, Jun 09 2016: (Start)
G.f.: x^2*(1+4*x+3*x^2)/((x-1)^2*(1+x+x^2)).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (24*n-30+3*cos(2*n*Pi/3)+5*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 8k-3, a(3k-1) = 8k-7, a(3k-2) = 8k-8. (End)
MAPLE
A047616:=n->(24*n-30+3*cos(2*n*Pi/3)+5*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047616(n), n=1..100); # Wesley Ivan Hurt, Jun 09 2016
MATHEMATICA
Select[Range[0, 150], MemberQ[{0, 1, 5}, Mod[#, 8]] &] (* Wesley Ivan Hurt, Jun 09 2016 *)
Table[8 n + {0, 1, 5}, {n, 0, 200}]//Flatten (* Vincenzo Librandi, Jun 11 2016 *)
LinearRecurrence[{1, 0, 1, -1}, {0, 1, 5, 8}, 60] (* Harvey P. Dale, Jul 20 2024 *)
PROG
(Magma) [n : n in [0..150] | n mod 8 in [0, 1, 5]]; // Wesley Ivan Hurt, Jun 09 2016
(PARI) a(n)=n\3*8+[-3, 0, 1][n%3+1] \\ Charles R Greathouse IV, Jul 19 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved