OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(n) = 7*floor(n/3)+(n mod 3)+1, with offset 0. - Gary Detlefs, Mar 09 2010
G.f.: x*(1+x+x^2+4*x^3)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Oct 08 2011
a(n) = 4*floor((n-1)/3)+n. - Gary Detlefs, Dec 22 2011
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (21*n-24-12*cos(2*n*Pi/3)+4*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 7k-4, a(3k-1) = 7k-5, a(3k-2) = 7k-6. (End)
MAPLE
seq(7*floor(n/3)+(n mod 3)+1, n=0..52); # Gary Detlefs, Mar 09 2010
MATHEMATICA
Select[Range[0, 200], Mod[#, 7] == 1 || Mod[#, 7] == 2 || Mod[#, 7] == 3 &] (* Vladimir Joseph Stephan Orlovsky, Jul 10 2011 *)
{1, 2, 3}+#&/@(7*Range[0, 20])//Flatten (* or *) LinearRecurrence[{1, 0, 1, -1}, {1, 2, 3, 8}, 90] (* Harvey P. Dale, Jul 23 2024 *)
PROG
(Magma) [n : n in [0..150] | n mod 7 in [1..3]]; // Wesley Ivan Hurt, Jun 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved