%I #40 Dec 31 2021 05:48:35
%S 1,2,3,4,5,6,8,9,10,11,12,13,15,16,17,18,19,20,22,23,24,25,26,27,29,
%T 30,31,32,33,34,36,37,38,39,40,41,43,44,45,46,47,48,50,51,52,53,54,55,
%U 57,58,59,60,61,62,64,65,66
%N Numbers not divisible by 7.
%C Numbers that are congruent to {1, 2, 3, 4, 5, 6} mod 7. Different from A020658.
%C More generally the sequence of numbers not divisible by some fixed integer m >= 2 is given by a(n,m) = n - 1 + floor((n+m-2)/(m-1)). - _Benoit Cloitre_, Jul 11 2009
%C Complement of A008589. - _Reinhard Zumkeller_, Nov 30 2009
%H Ivan Panchenko, <a href="/A047304/b047304.txt">Table of n, a(n) for n = 1..200</a>
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,1,-1).
%F a(n) = n - 1 + floor((n+5)/6). - _Benoit Cloitre_, Jul 11 2009
%F A109720(a(n)) = 1; A082784(a(n)) = 0. - _Reinhard Zumkeller_, Nov 30 2009
%F G.f.: x*(1+x+x^2+x^3+x^4+x^5+x^6) / ( (1+x)*(1+x+x^2)*(x^2-x+1)*(x-1)^2 ). - _R. J. Mathar_, Oct 08 2011
%F Sum_{n>=1} (-1)^(n+1)/a(n) = (cot(Pi/7) + tan(Pi/14) - tan(3*Pi/14))*Pi/7. - _Amiram Eldar_, Dec 31 2021
%t Select[Table[n,{n,200}],Mod[#,7]!=0&] (* _Vladimir Joseph Stephan Orlovsky_, Feb 18 2011 *)
%t Drop[Range[70],{7,-1,7}] (* or *) LinearRecurrence[{1,0,0,0,0,1,-1},{1,2,3,4,5,6,8},60] (* _Harvey P. Dale_, Aug 01 2021 *)
%o (Sage) [i for i in range(67) if gcd(7,i) == 1] # _Zerinvary Lajos_, Apr 21 2009
%o (PARI) a(n)=n-1+floor((n+5)/6) \\ _Benoit Cloitre_, Jul 11 2009
%Y Cf. A008589, A020658, A082784, A109720.
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_
|