Jump to content

Primality test

From Simple English Wikipedia, the free encyclopedia
Revision as of 10:58, 21 February 2022 by MathXplore (talk | changes) (Moving from Category:Number theory to Category:Prime numbers using Cat-a-lot)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A primality test is a method (or algorithm) to find out if a certain number is a prime number. Cryptography uses prime numbers, and needs to test if a certain number is prime. The official proof of a prime is through its primality certificate.

Simple methods

[change | change source]
  • Sieve of Eratosthenes: Determine if there is a number (between 2 and n, the number to test) that divides n, without a rest
  • Wilson's theorem (inefficient): evaluates to -1 mod p where p is the candidate prime number

Better methods

[change | change source]

.