Previous Page Next Page Contents

numlib::legendre -- Legendre symbol

Introduction

numlib::legendre(a, p) returns the Legendre symbol (a|p).

Call(s)

numlib::legendre(a, p)

Parameters

a - an integer
p - an odd prime

Returns

numlib::legendre(a,p) returns -1, 0, 1, or the function call with evaluated arguments.

Related Functions

numlib::jacobi, numlib::isquadres

Details

Example 1

Computing the Legendre symbol (132132 | 3231277):

>> numlib::legendre(132132,3231227)
                                     1

Example 2

Computing the Legendre symbol (132131 | 3231277):

>> numlib::legendre(132131,3231227)
                                    -1

Example 3

Computing the Legendre symbol (-303|101):

>> numlib::legendre(-303,101)
                                     0

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000