enow.com Web Search

Search results

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

    en.wikipedia.org/wiki/Sieve_of_Eratosthenes

    A prime number is a natural number that has exactly two distinct natural number divisors: the number 1 and itself. To find all the prime numbers less than or equal to a given integer n by Eratosthenes' method: Create a list of consecutive integers from 2 through n: (2, 3, 4, ..., n). Initially, let p equal 2, the smallest prime number.

  3. Primality test - Wikipedia

    en.wikipedia.org/wiki/Primality_test

    If the result is different from 1, then n is composite. If it is 1, then n may be prime. If a n1 (modulo n) is 1 but n is not prime, then n is called a pseudoprime to base a. In practice, if a n1 (modulo n) is 1, then n is usually prime. But here is a counterexample: if n = 341 and a = 2, then

  4. Miller–Rabin primality test - Wikipedia

    en.wikipedia.org/wiki/Miller–Rabin_primality_test

    This is not a probabilistic factorization algorithm because it is only able to find factors for numbers n which are pseudoprime to base a (in other words, for numbers n such that a n11 mod n). For other numbers, the algorithm only returns “composite” with no further information. For example, consider n = 341 and a = 2. We have n − ...

  5. Fermat primality test - Wikipedia

    en.wikipedia.org/wiki/Fermat_primality_test

    Using fast algorithms for modular exponentiation and multiprecision multiplication, the running time of this algorithm is O(k log 2 n log log n) = Õ(k log 2 n), where k is the number of times we test a random a, and n is the value we want to test for primality; see Miller–Rabin primality test for details.

  6. Fermat's little theorem - Wikipedia

    en.wikipedia.org/wiki/Fermat's_little_theorem

    Fermat's little theorem is indeed a special case, because if n is a prime number, then φ(n) = n1. A corollary of Euler's theorem is: For every positive integer n , if the integer a is coprime with n , then x ≡ y ( mod φ ( n ) ) implies a x ≡ a y ( mod n ) , {\displaystyle x\equiv y{\pmod {\varphi (n)}}\quad {\text{implies}}\quad a^{x ...

  7. Integer factorization - Wikipedia

    en.wikipedia.org/wiki/Integer_factorization

    To factorize a small integer n using mental or pen-and-paper arithmetic, the simplest method is trial division: checking if the number is divisible by prime numbers 2, 3, 5, and so on, up to the square root of n. For larger numbers, especially when using a computer, various more sophisticated factorization algorithms are more efficient.

  8. 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.

  9. List of prime numbers - Wikipedia

    en.wikipedia.org/wiki/List_of_prime_numbers

    A prime number (or prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. By Euclid's theorem, there are an infinite number of prime numbers. Subsets of the prime numbers may be generated with various formulas for primes.