enow.com Web Search

Search results

  1. Results from the WOW.Com Content Network
  2. Sieve of Sundaram - Wikipedia

    en.wikipedia.org/wiki/Sieve_of_Sundaram

    Sieve of Sundaram: algorithm steps for primes below 202 (unoptimized). The sieve starts with a list of the integers from 1 to n.From this list, all numbers of the form i + j + 2ij are removed, where i and j are positive integers such that 1 ≤ i ≤ j and i + j + 2ij ≤ n.

  3. Sieve of Eratosthenes - Wikipedia

    en.wikipedia.org/wiki/Sieve_of_Eratosthenes

    algorithm Sieve of Eratosthenes is input: an integer n > 1. output: all prime numbers from 2 through n. let A be an array of Boolean values, indexed by integers 2 to n, initially all set to true. for i = 2, 3, 4, ..., not exceeding √ n do if A[i] is true for j = i 2, i 2 +i, i 2 +2i, i 2 +3i, ..., not exceeding n do set A[j] := false return ...

  4. Sieve of Atkin - Wikipedia

    en.wikipedia.org/wiki/Sieve_of_Atkin

    The following is pseudocode which combines Atkin's algorithms 3.1, 3.2, and 3.3 [1] by using a combined set s of all the numbers modulo 60 excluding those which are multiples of the prime numbers 2, 3, and 5, as per the algorithms, for a straightforward version of the algorithm that supports optional bit-packing of the wheel; although not specifically mentioned in the referenced paper, this ...

  5. Generation of primes - Wikipedia

    en.wikipedia.org/wiki/Generation_of_primes

    A prime sieve or prime number sieve is a fast type of algorithm for finding primes. There are many prime sieves. The simple sieve of Eratosthenes (250s BCE), the sieve of Sundaram (1934), the still faster but more complicated sieve of Atkin [1] (2003), sieve of Pritchard (1979), and various wheel sieves [2] are most common.

  6. Sieve theory - Wikipedia

    en.wikipedia.org/wiki/Sieve_theory

    One assumes then that () can be written as = + ()where () is a density, meaning a multiplicative function such that =, <and is an approximation of () and () is some remainder term.

  7. Legendre sieve - Wikipedia

    en.wikipedia.org/wiki/Legendre_sieve

    In this example the fact that the Legendre identity is derived from the Sieve of Eratosthenes is clear: the first term is the number of integers below X, the second term removes the multiples of all primes, the third term adds back the multiples of two primes (which were miscounted by being "crossed out twice") but also adds back the multiples ...

  8. Sieve of Pritchard - Wikipedia

    en.wikipedia.org/wiki/Sieve_of_Pritchard

    1 2 3 5. The first number after 1 for wheel 2 is 5; note it as a prime. Now form wheel 3 with length 5 × 6 = 30 by first extending wheel 2 up to 30 and then deleting 5 times each number in wheel 2 (in reverse order!), to get 1 2 3 5 7 11 13 17 19 23 25 29. The first number after 1 for wheel 3 is 7; note it as a prime. Now wheel 4 has length 7 ...

  9. Byte Sieve - Wikipedia

    en.wikipedia.org/wiki/Byte_Sieve

    REM Eratosthenes Sieve Prime Number Program in BASIC 1 SIZE = 8190 2 DIM FLAGS (8191) 3 PRINT "Only 1 iteration" 5 COUNT = 0 6 FOR I = 0 TO SIZE 7 FLAGS (I) = 1 8 NEXT I 9 FOR I = 0 TO SIZE 10 IF FLAGS (I) = 0 THEN 18 11 PRIME = I + I + 3 12 K = I + PRIME 13 IF K > SIZE THEN 17 14 FLAGS (K) = 0 15 K = K + PRIME 16 GOTO 13 17 COUNT = COUNT + 1 ...