$$\newcommand{\mtn}{\mathbb{N}}\newcommand{\mtns}{\mathbb{N}^*}\newcommand{\mtz}{\mathbb{Z}}\newcommand{\mtr}{\mathbb{R}}\newcommand{\mtk}{\mathbb{K}}\newcommand{\mtq}{\mathbb{Q}}\newcommand{\mtc}{\mathbb{C}}\newcommand{\mch}{\mathcal{H}}\newcommand{\mcp}{\mathcal{P}}\newcommand{\mcb}{\mathcal{B}}\newcommand{\mcl}{\mathcal{L}} \newcommand{\mcm}{\mathcal{M}}\newcommand{\mcc}{\mathcal{C}} \newcommand{\mcmn}{\mathcal{M}}\newcommand{\mcmnr}{\mathcal{M}_n(\mtr)} \newcommand{\mcmnk}{\mathcal{M}_n(\mtk)}\newcommand{\mcsn}{\mathcal{S}_n} \newcommand{\mcs}{\mathcal{S}}\newcommand{\mcd}{\mathcal{D}} \newcommand{\mcsns}{\mathcal{S}_n^{++}}\newcommand{\glnk}{GL_n(\mtk)} \newcommand{\mnr}{\mathcal{M}_n(\mtr)}\DeclareMathOperator{\ch}{ch} \DeclareMathOperator{\sh}{sh}\DeclareMathOperator{\th}{th} \DeclareMathOperator{\vect}{vect}\DeclareMathOperator{\card}{card} \DeclareMathOperator{\comat}{comat}\DeclareMathOperator{\imv}{Im} \DeclareMathOperator{\rang}{rg}\DeclareMathOperator{\Fr}{Fr} \DeclareMathOperator{\diam}{diam}\DeclareMathOperator{\supp}{supp} \newcommand{\veps}{\varepsilon}\newcommand{\mcu}{\mathcal{U}} \newcommand{\mcun}{\mcu_n}\newcommand{\dis}{\displaystyle} \newcommand{\croouv}{[\![}\newcommand{\crofer}{]\!]} \newcommand{\rab}{\mathcal{R}(a,b)}\newcommand{\pss}[2]{\langle #1,#2\rangle} $$
Bibm@th

Test de primalité de Miller-Rabin

  Soit $n$ un nombre premier impair que l'on décompose sous la forme $n=2^s\times d+1$. Alors $n$ a la propriété suivante : pour tout entier $a$ compris entre $1$ et $n-1$, alors
  • ou bien $a^d\equiv 1\ [n]$;
  • ou bien il existe $i$ dans $\{1,…,s-1\}$ tel que $a^{2^id}\equiv -1\ [n]$.
  On peut en déduire un test probabiliste de probabilité d'un entier. Prenons maintenant $n$ impair quelconque, qu'on écrit $n=2^s\times d+1$, et $a$ toujours compris entre $1$ et $n-1$. Si
  • ou bien $a^d\equiv 1\ [n]$
  • ou bien il existe $i$ dans $\{1,…,s-1\}$ tel que $a^{2^id}\equiv -1\ [n]$

on dit que $n$ passe le test. Un entier premier $n$ va passer le test pour tout entier $a$. Toutefois, pour un $a$ fixé, un entier non premier $n$ peut aussi passer le test. On démontre qu'il ne peut pas le passer pour plus d'un quart des entiers $a$ compris entre $1$ et $n-1$. En répétant le test avec plusieurs entiers $a$ différents, on pourra donc affirmer, s'il passe les différents tests, que $n$ est probablement premier.
Consulter aussi
Recherche alphabétique
Recherche thématique