Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3).
Navigation
Topics Help • Register • News • History • How to • Sequences statistics • Template prototypes

Difference between revisions of "Lucas primality test"

From Prime-Wiki
Jump to: navigation, search
m
(Adding to new subcategory)
 
Line 20: Line 20:
  
 
==External links==
 
==External links==
*[https://en.wikipedia.org/wiki/Lucas_primality_test Wikipedia]
+
*[[wikipedia:Lucas primality test|Wikipedia]]
[[Category:Primality tests]]
+
 
 +
[[Category:Deterministic primality tests]]

Latest revision as of 01:13, 11 August 2024

The Lucas primality test invented in 1891 by Édouard Lucas, determines whether a number N is prime or not, using the complete factorization of N-1.

If, for some integer b, the quantity bN-1 is congruent to 1 modulo N, and if b(N-1)/q is not congruent to 1 modulo N for any prime divisor q of N-1, then N is a prime.

Example

Prove that N = 811 is prime knowing that N-1 = 2 × 34 × 5

Let's start with b = 3.

3810/2=3405810(mod811)
3810/3=3270680(mod811)
3810/5=3162212(mod811)
38101(mod811)

All conditions of the test hold so 811 is prime.

The fourth computation is not needed: compute b(N-1)/2 as done in the example, if it is congruent to 1, the value b must be changed, if it is congruent to N-1, the first condition of the test holds, otherwise N is composite.

Notice the b = 7 is a bad choice because:

7810/2=74051(mod811)

External links