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
From Bruno Berselli, Mar 25 2011: (Start)
G.f.: x*(1+2*x+2*x^2+2*x^3)/((1-x)^2*(1+x+x^2)).
a(n) = 7*floor((n-1)/3)+2*(n-1 mod 3)+1.
a(n) = (1/3)*(7*n-5-A049347(n)). (End)
From Wesley Ivan Hurt, Jun 13 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (21*n-15-3*cos(2*n*Pi/3)+sqrt(3)*sin(2*Pi*n/3))/9.
a(3k) = 7k-2, a(3k-1) = 7k-4, a(3k-2) = 7k-6. (End)
a(n) = n - 1 + floor((4n-1)/3). - Wesley Ivan Hurt, Dec 27 2016
MAPLE
A047391:=n->(21*n-15-3*cos(2*n*Pi/3)+sqrt(3)*sin(2*Pi*n/3))/9: seq(A047391(n), n=1..100); # Wesley Ivan Hurt, Jun 13 2016
MATHEMATICA
Select[Range[0, 150], MemberQ[{1, 3, 5}, Mod[#, 7]] &] (* Wesley Ivan Hurt, Jun 13 2016 *)
LinearRecurrence[{1, 0, 1, -1}, {1, 3, 5, 8}, 100] (* Vincenzo Librandi, Jun 14 2016 *)
PROG
(Magma) [n: n in [1..122] | n mod 7 in [1, 3, 5]]; // Bruno Berselli, Mar 25 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved