.. _sphx_glr_api_gallery_number_theory_primality:
Primality
-----------
Trial division, Miller-Rabin, and the sieve of Eratosthenes.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /api/gallery/number_theory/primality/images/thumb/sphx_glr_plot_01_miller_rabin_thumb.png
:alt:
:doc:`/api/gallery/number_theory/primality/plot_01_miller_rabin`
.. raw:: html
The Miller-Rabin probabilistic primality test
.. raw:: html
.. only:: html
.. image:: /api/gallery/number_theory/primality/images/thumb/sphx_glr_plot_02_lucas_lehmer_thumb.png
:alt:
:doc:`/api/gallery/number_theory/primality/plot_02_lucas_lehmer`
.. raw:: html
Mersenne primes and the Lucas-Lehmer test
.. raw:: html
.. only:: html
.. image:: /api/gallery/number_theory/primality/images/thumb/sphx_glr_plot_03_prime_counting_thumb.png
:alt:
:doc:`/api/gallery/number_theory/primality/plot_03_prime_counting`
.. raw:: html
The prime-counting function and the prime number theorem
.. thumbnail-parent-div-close
.. raw:: html
.. toctree::
:hidden:
/api/gallery/number_theory/primality/plot_01_miller_rabin
/api/gallery/number_theory/primality/plot_02_lucas_lehmer
/api/gallery/number_theory/primality/plot_03_prime_counting