Math 2.0

statement theorem

Lucas–Lehmer test

Statement

Let pp be an odd prime, and let Mp=2p−1M_p = 2^p - 1 be the Mersenne number. Define the sequence (si)i≥0(s_i)_{i \ge 0} by s0=4s_0 = 4 and si=si−12−2s_i = s_{i-1}^2 - 2 for i≥1i \ge 1. Then MpM_p is prime if and only if sp−2≡0(modMp)s_{p-2} \equiv 0 \pmod{M_p}.

Remarks

For example, take p=5p = 5 and M5=31M_5 = 31. Modulo 3131, the sequence is 4,14,8,04, 14, 8, 0, so s3≡0s_3 \equiv 0 and 3131 is prime. In practice, one reduces each term modulo MpM_p. Then the test needs p−2p - 2 squarings of numbers with at most pp bits.

History

Édouard Lucas developed the test in 1878, and Derrick Henry Lehmer proved it in 1930.

Explanations

L1 human

The test checks a Mersenne number for primality with a simple loop: square, subtract 22, and reduce modulo MpM_p. After p−2p - 2 steps, the result is 00 exactly when MpM_p is prime.

What this node needs for W2
  • edge about out: the concepts that the statement is about (0 of 1)
  • edge proves in: at least one proof node (0 of 1)
  • edge instance_of or illustrates in: one example that shows the statement at work (0 of 1)
  • explanation L2 (0 of 1)

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

What this needs

To read this node, read these 4 nodes in this order. The foundations come first, and the list ends with this node.

Each node uses the nodes above it. The colour of the bar on a box shows the evidence level, and the box also gives it as text. The list below has the same nodes.
  • no evidence level
  1. Divisibility definition
  2. Mersenne number definition
  3. Congruence modulo n definition
  4. Lucas–Lehmer test statement

Sources

  1. Web https://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer_primality_test, The test