Math 2.0

concept

Fermat primality test

Summary

The Fermat primality test is a probabilistic test of whether an integer n>1n > 1 is prime. It chooses a base aa with 1<a<n−11 < a < n - 1 and computes an−1 mod na^{n-1} \bmod n by modular exponentiation. If the result is not 11, then nn is composite, by Fermat's little theorem. If the result is 11, then nn is called a probable prime to the base aa.

Remarks

A probable prime can be composite. Such a number is a Fermat pseudoprime. The Carmichael numbers pass the test for each base coprime to them. So repeated tests with many bases cannot detect all composite numbers. The Miller–Rabin primality test is a stronger test of the same kind, without this weakness.

Explanations

L1 human

To test n=15n = 15 with a=2a = 2, compute 214=16384≡4(mod15)2^{14} = 16384 \equiv 4 \pmod{15}. The result is not 11, so 1515 is surely composite. The test does not find a factor; it only proves that one exists.

What this node needs for W1
  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

Sources

  1. Web https://en.wikipedia.org/wiki/Fermat_primality_test, Concept