Previous Up Next

6.5.24  Legendre symbol: legendre_symbol

If n is prime, the Legendre symbol of a is written (a/n) and defined by:




a
n







       0if  a=0 modn 
       1if  a ≠ 0 modn  and if  a=b2 modn
      −1if  a ≠ 0 modn  and if  a ≠ b2 modn
   

The Legendre symbol satisfies the following properties.

The legendre_symbol command computes the Legendre symbol.


Examples.


Previous Up Next