%I #17 Sep 08 2022 08:44:57
%S 1,4,5,8,11,12,15,18,19,22,25,26,29,32,33,36,39,40,43,46,47,50,53,54,
%T 57,60,61,64,67,68,71,74,75,78,81,82,85,88,89,92,95,96,99,102,103,106,
%U 109,110,113,116,117,120,123,124,127,130,131,134,137,138,141
%N Numbers that are congruent to {1, 4, 5} mod 7.
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).
%F G.f.: x*(1+3*x+x^2+2*x^3) / ((1+x+x^2)*(x-1)^2). - _R. J. Mathar_, Dec 04 2011
%F From _Wesley Ivan Hurt_, Jun 09 2016: (Start)
%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
%F a(n) = (21*n-12-6*cos(2*n*Pi/3)-2*sqrt(3)*sin(2*n*Pi/3))/9.
%F a(3k) = 7k-2, a(3k-1) = 7k-3, a(3k-2) = 7k-6. (End)
%p A047376:=n->(21*n-12-6*cos(2*n*Pi/3)-2*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047376(n), n=1..100); # _Wesley Ivan Hurt_, Jun 09 2016
%t Select[Range[200], MemberQ[{1,4,5}, Mod[#,7]]&] (* _Harvey P. Dale_, Feb 24 2011 *)
%o (Magma) [n : n in [0..150] | n mod 7 in [1, 4, 5]]; // _Wesley Ivan Hurt_, Jun 09 2016
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_