If n is prime, we define the Legendre symbol of a
written (a/n) by :
⎛ ⎜ ⎜ ⎝ |
| ⎞ ⎟ ⎟ ⎠ | = | ⎧ ⎪ ⎨ ⎪ ⎩ |
|
Some properties
a |
| = | ⎛ ⎜ ⎜ ⎝ |
| ⎞ ⎟ ⎟ ⎠ | modn |
|
legendre_symbol takes two arguments a and n and returns the Legendre
symbol (a/n).
Input :
Output :
Input :
Output :
Input :
Output :