diff --git a/content/03_euler_et_exp.md b/content/03_euler_et_exp.md new file mode 100644 index 0000000000000000000000000000000000000000..ca2d7cec09f2f806b3cf71af25e1cbddd34fa899 --- /dev/null +++ b/content/03_euler_et_exp.md @@ -0,0 +1,68 @@ +# 9 mars + +## Fonction d'Euler + +Soit un entier $n$, la fonction d'Euler $\varphi(n)$ est le nombre d'entiers dans $\ringmod{n}$, qui sont premiers relativement à $n$. + +$$ +n = \prod_{i=1}^{i=k}(1-p_{i}^{-1}) +$$ + +où $p$ est premier et $p_{i}^{-1} = \frac{1}{p_{i}}$ + +avec $n = \prod_{i=1}^{i=k}p_{i}^{\alpha_{i}}$ + +### Exemple + +#### Décomposition en facteurs premiers + +$$ +\begin{aligned} + n = 10 = 2 \cdot 5 \\ + n = 5000 = 2^3 \cdot 5^4 +\end{aligned} +$$ + +où $2 \Rightarrow p_{1}^{\alpha_{1}} et 5 \Rightarrow p_{2}^{\alpha_{2}}$ + +#### Calcul + +$$ +\begin{aligned} + \varphi(10) = 10 \cdot (1 - \frac{1}{2}) \cdot (1 - \frac{1}{5}) \\ + = 10 \cdot \frac{1}{2} \cdot \frac{4}{5} \\ + = \frac{4 \cdot 10}{10} + = 4 +\end{aligned} +$$ + +## Exponentiation Modulaire + +### Exemple + +$$ +17^{73} \bmod 133 +$$ + +#### Conversion de l'exposant en binaire + +$$ +\begin{aligned} +(73)_{10} = (1001001)_{2} \\ +2^0 + 2^3 + 2^6 = 73 +\end{aligned} +$$ + +#### Calcul grâce au tableau + +| Valeur binaire pour $i$ | $17^{2^{i}} \bmod 133$ | Résultat | +| ----------------------- | ------------------------ | -------- | +| $i = 0 \Rightarrow 1$ | $17^{1} \bmod 133$ | 17 | +| $i = 1 \Rightarrow 0$ | $17^{2} = 289 \bmod 133$ | 23 | +| $i = 2 \Rightarrow 0$ | $17^{4} = 17$ | +| $i = 3 \Rightarrow 1$ | +| $i = 4 \Rightarrow 0$ | +| $i = 5 \Rightarrow 0$ | +| $i = 6 \Rightarrow 1$ | + +## Euclide étendu et coefficients de Bézout