A066680 Badly sieved numbers: as in the Sieve of Eratosthenes multiples of unmarked numbers p are marked, but only up to p^2.
2, 3, 5, 7, 8, 11, 12, 13, 17, 18, 19, 23, 27, 29, 30, 31, 37, 41, 43, 45, 47, 50, 53, 59, 61, 63, 67, 70, 71, 73, 75, 79, 80, 83, 89, 97, 98, 101, 103, 105, 107, 109, 112, 113, 125, 127, 128, 131, 137, 139, 147, 149, 151, 154, 157, 163
Offset: 1
Examples
For 2, the first unmarked number, there is only one multiple <= 4=2^2: giving 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... for 3, the next unmarked number, we mark 6=2*3 and 9=3*3 giving 2 3 [4] 5 [6] 7 8 [9] 10 11 12 13 14 15 16 17 18 19 20 ... for 5, the next unmarked number, we mark 10=2*5, 15=3*5, 20=4*5 and 25=5*5 giving 2 3 [4] 5 [6] 7 8 [9] [10] 11 12 13 14 [15] 16 17 18 19 [20] ... and so on.
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
- Eric Weisstein's World of Mathematics, Sieve
- Wikipedia, Sieve theory
- Index entries for sequences generated by sieves
Crossrefs
Programs
-
Haskell
a066680 n = a066680_list !! (n-1) a066680_list = s [2..] where s (b:bs) = b : s [x | x <- bs, x > b ^ 2 || mod x b > 0] -- Reinhard Zumkeller, Feb 17 2012
-
Mathematica
A099104[1] = 0; A099104[n_] := A099104[n] = Product[If[n > d^2, 1, 1 - A099104[d]], {d, Select[ Range[n-1], Mod[n, #] == 0 &]}]; Select[ Range[200], A099104[#] == 1 &] (* Jean-François Alcover, Feb 15 2012 *) max = 200; badPrimes = Range[2, max]; len = max; iter = 1; While[iter <= len, curr = badPrimes[[iter]]; badPrimes = Complement[badPrimes, Range[2, curr]curr]; len = Length[badPrimes]; iter++]; badPrimes (* Alonso del Arte, Feb 21 2012 *)
Comments