ArticleslgStudy

science

Lucas primality test

Lucas primality test is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Lucas primality test rather than just read about it. In short: In computational number theory, the Lucas test is a primality test for a natural number n; it requires that the prime factors of n − 1 be already known. It is the basis of the Pratt certificate that gives a concise verification that n is prime.

Key takeaways

  • Lucas primality test belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Lucas primality test to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Lucas primality test from memory before moving on to harder problems.

Reference excerpt

In computational number theory, the Lucas test is a primality test for a natural number n; it requires that the prime factors of n − 1 be already known. It is the basis of the Pratt certificate that gives a concise verification that n is prime.

Concepts Let n be a positive integer. If there exists an integer a, 1 < a < n, such that

a n − 1 ≡ 1 ( mod n ) {\displaystyle a^{n-1}\ \equiv \ 1{\pmod {n}}\,}

and for every prime factor q of n − 1

a ( n − 1 ) / q ≢ 1 ( mod n ) {\displaystyle a^{({n-1})/q}\ \not \equiv \ 1{\pmod {n}}\,}

then n is prime. If no such number a exists, then n is either 1, 2, or composite. The reason for the correctness of this claim is as follows: if the first equivalence holds for a, we can deduce that a and n are coprime. If a also survives the second step, then the order of a in the group (Z/nZ)* is equal to n − 1, which means that the order of that group is n − 1 (because the order of every element of a group divides the order of the group), implying that n is prime. Conversely, if n is prime, then there exists a primitive root modulo n, or generator of the group (Z/nZ)*. Such a generator has order |(Z/nZ)*| = n − 1 and both equivalences will hold for any such primitive root. Note that if there exists an a < n such that the first equivalence fails, a is called a Fermat witness for the compositeness of n.

Example For example, take n = 71. Then n − 1 = 70 and the prime factors of 70 are 2, 5 and 7. We randomly select an a = 17 < n. Now we compute:

17 70 ≡ 1 ( mod 71 ) . {\displaystyle 17^{70}\ \equiv \ 1{\pmod {71}}.}

For all integers a it is known that

a n − 1 ≡ 1 ( mod n ) if and only if ord ( a ) ∣ ( n − 1 ) . {\displaystyle a^{n-1}\equiv 1{\pmod {n}}\ {\text{ if and only if }}{\text{ ord}}(a)\mid (n-1).}

Therefore, the multiplicative order of 17 (mod 71) is not necessarily 70 because some factor of 70 may also work above. So check 70 divided by its prime factors:

17 35 ≡ 70 ≢ 1 ( mod 71 ) {\displaystyle 17^{35}\ \equiv \ 70\ \not \equiv \ 1{\pmod {71}}}

17 14 ≡ 25 ≢ 1 ( mod 71 ) {\displaystyle 17^{14}\ \equiv \ 25\ \not \equiv \ 1{\pmod {71}}}

17 10 ≡ 1 ≡ 1 ( mod 71 ) . {\displaystyle 17^{10}\ \equiv \ 1\ \equiv \ 1{\pmod {71}}.}

Unfortunately, we get that 1710 ≡ 1 (mod 71). So we still do not know if 71 is prime or not. We try another random a, this time choosing a = 11. Now we compute:

11 70 ≡ 1 ( mod 71 ) . {\displaystyle 11^{70}\ \equiv \ 1{\pmod {71}}.}

Again, this does not show that the multiplicative order of 11 (mod 71) is 70 because some factor of 70 may also work. So check 70 divided by its prime factors:

11 35 ≡ 70 ≢ 1 ( mod 71 ) {\displaystyle 11^{35}\ \equiv \ 70\ \not \equiv \ 1{\pmod {71}}}

11 14 ≡ 54 ≢ 1 ( mod 71 ) {\displaystyle 11^{14}\ \equiv \ 54\ \not \equiv \ 1{\pmod {71}}}

11 10 ≡ 32 ≢ 1 ( mod 71 ) . {\displaystyle 11^{10}\ \equiv \ 32\ \not \equiv \ 1{\pmod {71}}.}

So the multiplicative order of 11 (mod 71) is 70, and thus 71 is prime. (To carry out these modular exponentiations, one could use a fast exponentiation algorithm like binary or addition-chain exponentiation).

Algorithm The algorithm can be written in pseudocode as follows:

algorithm lucas_primality_test is input: n > 2, an odd integer to be tested for primality. k, a parameter that determines the accuracy of the test. output: prime if n is prime, otherwise composite or possibly composite.

determine the prime factors of n−1.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Lucas primality test

Start with the simplest possible case. Write down what Lucas primality test claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Lucas primality test before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Lucas primality test ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Lucas primality test

In research
Lucas primality test appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Lucas primality test in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Lucas primality test is common in secondary-school and first-year university syllabi. It links to neighbouring topics Primality tests, so understanding it makes those chapters shorter.
In everyday life
Look for Lucas primality test outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Lucas primality test in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Lucas primality test means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Lucas primality test out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Lucas primality test in simple terms?

In computational number theory, the Lucas test is a primality test for a natural number n; it requires that the prime factors of n − 1 be already known. It is the basis of the Pratt certificate that gives a concise verification that n is prime.

Why does Lucas primality test matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Lucas primality test?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Lucas primality test.

Tags

  • Primality tests

Keep exploring