Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Lucas primality test
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==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: :<math>17^{70}\ \equiv\ 1 \pmod {71}.</math> For all integers ''a'' it is known that :<math>a^{n - 1}\equiv 1 \pmod{n}\ \text{ if and only if } \text{ ord}(a)|(n-1).</math> 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: :<math>17^{35}\ \equiv\ 70\ \not\equiv\ 1 \pmod {71}</math> :<math>17^{14}\ \equiv\ 25\ \not\equiv\ 1 \pmod {71}</math> :<math>17^{10}\ \equiv\ 1\ \equiv\ 1 \pmod {71}.</math> Unfortunately, we get that 17<sup>10</sup>≡1 (mod 71). So we still don't know if 71 is prime or not. We try another random ''a'', this time choosing ''a'' = 11. Now we compute: :<math>11^{70}\ \equiv\ 1 \pmod {71}.</math> 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: :<math>11^{35}\ \equiv\ 70\ \not\equiv\ 1 \pmod {71}</math> :<math>11^{14}\ \equiv\ 54\ \not\equiv\ 1 \pmod {71}</math> :<math>11^{10}\ \equiv\ 32\ \not\equiv\ 1 \pmod {71}.</math> So the multiplicative order of 11 (mod 71) is 70, and thus 71 is prime. (To carry out these [[modular exponentiation]]s, one could use a fast exponentiation algorithm like [[Exponentiation by squaring|binary]] or [[addition-chain exponentiation]]).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)