next up previous contents index
suivant: Symbole de Jacobi : monter: Les entiers (et les précédent: Indicatrice d'Euler : euler   Table des matières   Index


Symbole de Legendre : legendre_symbol

Lorsque n est premier, on définit le symbole de Legendre de a noté $ \left(\vphantom{\frac{a}{n}}\right.$$ {\frac{{a}}{{n}}}$$ \left.\vphantom{\frac{a}{n}}\right)$ par :

$\displaystyle \left(\vphantom{\frac{a}{n}}\right.$$\displaystyle {\frac{{a}}{{n}}}$$\displaystyle \left.\vphantom{\frac{a}{n}}\right)$ = $\displaystyle \left\{\vphantom{\begin{array}{rl}
0 & \mbox{si }a=0 \bmod n  ...
...si } a \neq 0 \bmod n \mbox{ et si } a \neq b^2 \bmod n\\
\end{array}}\right.$$\displaystyle \begin{array}{rl}
0 & \mbox{si }a=0 \bmod n \\
1 & \mbox{si } ...
...& \mbox{si } a \neq 0 \bmod n \mbox{ et si } a \neq b^2 \bmod n\\
\end{array}$

On a pour n est premier :
a$\scriptstyle {\frac{}{}}$n-12 = $ \left(\vphantom{\frac{a}{n}}\right.$$ {\frac{{a}}{{n}}}$$ \left.\vphantom{\frac{a}{n}}\right)$ mod n
On a aussi :
$ \left(\vphantom{\frac{p}{q}}\right.$$ {\frac{{p}}{{q}}}$$ \left.\vphantom{\frac{p}{q}}\right)$.$ \left(\vphantom{\frac{q}{p}}\right.$$ {\frac{{q}}{{p}}}$$ \left.\vphantom{\frac{q}{p}}\right)$ = (- 1)$\scriptstyle {\frac{{p-1}}{{2}}}$.(- 1)$\scriptstyle {\frac{{q-1}}{{2}}}$ lorsque p et q sont impairs et positifs,
$ \left(\vphantom{\frac{2}{p}}\right.$$ {\frac{{2}}{{p}}}$$ \left.\vphantom{\frac{2}{p}}\right)$ = (- 1)$\scriptstyle {\frac{{p^2-1}}{{8}}}$,
$ \left(\vphantom{\frac{-1}{p}}\right.$$ {\frac{{-1}}{{p}}}$$ \left.\vphantom{\frac{-1}{p}}\right)$ = (- 1)$\scriptstyle {\frac{{p-1}}{{2}}}$.
legendre_symbol a deux paramètres a et n et renvoie le symbole de Legendre $ \left(\vphantom{\frac{a}{n}}\right.$$ {\frac{{a}}{{n}}}$$ \left.\vphantom{\frac{a}{n}}\right)$.
On tape :
legendre_symbol(26,17)
On obtient :
1
On tape :
legendre_symbol(27,17)
On obtient :
-1
On tape :
legendre_symbol(34,17)
On obtient :
0


Documentation de giac écrite par Renée De Graeve