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}$

Quelques propriétés

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