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

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

%S 1,2,4,5,6,8,9,11,12,13,15,16,18,19,20,22,23,25,26,27,29,30,32,33,34,

%T 36,37,39,40,41,43,44,46,47,48,50,51,53,54,55,57,58,60,61,62,64,65,67,

%U 68,69,71,72,74,75,76,78,79

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

%H Vincenzo Librandi, <a href="/A047317/b047317.txt">Table of n, a(n) for n = 1..1000</a>

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

%F a(n) = a(n-1) + a(n-5) - a(n-6).

%F a(n) = floor((7*n-1)/5). - _Gary Detlefs_, May 14 2001

%F G.f.: x*(1 + x + 2*x^2 + x^3 + x^4 + x^5) / ( (x^4 + x^3 + x^2 + x + 1)*(x-1)^2 ). - _R. J. Mathar_, Dec 03 2011

%t CoefficientList[Series[(1 + x + 2 x^2 + x^3 + x^4 + x^5) / ((x^4 + x^3 + x^2 + x + 1) (x - 1)^2), {x, 0, 60}], x] (* _Vincenzo Librandi_, Jul 26 2013 *)

%t LinearRecurrence[{1,0,0,0,1,-1},{1,2,4,5,6,8},100] (* _Harvey P. Dale_, Apr 02 2017 *)

%o (Magma) [n: n in [1..80] | n mod 7 in [1,2,4,5,6]]; // _Vincenzo Librandi_, Jul 26 2013

%K nonn,easy

%O 1,2

%A _N. J. A. Sloane_