login
Numbers that are congruent to {1, 4, 6} mod 7.
7

%I #27 Sep 08 2022 08:44:56

%S 1,4,6,8,11,13,15,18,20,22,25,27,29,32,34,36,39,41,43,46,48,50,53,55,

%T 57,60,62,64,67,69,71,74,76,78,81,83,85,88,90,92,95,97,99,102,104,106,

%U 109,111,113,116,118,120,123,125,127,130,132,134,137,139,141

%N Numbers that are congruent to {1, 4, 6} mod 7.

%H Vincenzo Librandi, <a href="/A047290/b047290.txt">Table of n, a(n) for n = 1..5000</a>

%H Melvyn B. Nathanson, <a href="http://dx.doi.org/10.4169/amer.math.monthly.120.05.409">On the fractional parts of roots of positive real numbers</a>, Amer. Math. Monthly, 120 (2013), 409-429 [see p. 417].

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).

%F From _Colin Barker_, Mar 13 2012

%F G.f.: x*(1+3*x+2*x^2+x^3)/((1-x)^2*(1+x+x^2)).

%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. (End)

%F From _Wesley Ivan Hurt_, Jun 13 2016: (Start)

%F a(n) = (21*n-9-2*sqrt(3)*sin(2*n*Pi/3))/9.

%F a(3k) = 7k-1, a(3k-1) = 7k-3, a(3k-2) = 7k-6. (End)

%p A047290:=n->(21*n-9-2*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047290(n), n=1..100); # _Wesley Ivan Hurt_, Jun 13 2016

%t Select[Range[0,12000], MemberQ[{1,4,6}, Mod[#,7]]&] (* _Vincenzo Librandi_, Apr 26 2012 *)

%t LinearRecurrence[{1,0,1,-1}, {1,4,6,8}, 60] (* _Harvey P. Dale_, Sep 19 2014 *)

%o (Magma) I:=[1, 4, 6, 8]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // _Vincenzo Librandi_ Apr 26 2012

%K nonn,easy

%O 1,2

%A _N. J. A. Sloane_