focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / jacobi
1 NAME
2     jacobi - Jacobi symbol function
3
4 SYNOPSIS
5     jacobi(x, y)
6
7 TYPES
8     x           integer
9     y           integer
10
11     return      1, -1, or 0
12
13 DESCRIPTION
14     If y is a positive odd prime and x is an integer not divisible
15     by y, jacobi(x,y) returns the Legendre symbol function, usually
16     denoted by (x/y) as if x/y were a fraction; this has the value
17     1 or -1 according as x is or is not a quadratic residue modulo y.
18     x is a quadratic residue modulo y if for some integer u,
19     x = u^2 (mod y); if for all integers u, x != u^2 (mod y), x
20     is said to be a quadratic nonresidue modulo y.
21
22     If y is a positive odd prime and x is divisible by y, jacobi(x,y)
23     returns the value 1.  (This differs from the zero value usually
24     given in number theory books for (x/y) when x and y
25     are not relatively prime.)
26     assigned to (x/y) O
27
28     If y is an odd positive integer equal to p_1 * p_2 * ... * p_k,
29     where the p_i are primes, not necessarily distinct, the
30     jacobi symbol function is given by
31
32                 jacobi(x,y)  =  (x/p_1) * (x/p_2) * ... * (x/p_k).
33
34     where the functions on the right are Legendre symbol functions.
35
36     This is also often usually by (x/y).
37
38     If jacobi(x,y) = -1, then x is a quadratic nonresidue modulo y.
39     Equivalently, if x is a quadratic residue modulo y, then
40     jacobi(x,y) = 1.
41
42     If jacobi(x,y) = 1 and y is composite, x may be either a quadratic
43     residue or a quadratic nonresidue modulo y.
44
45     If y is even or negative, jacobi(x,y) as defined by calc returns
46     the value 0.
47
48 EXAMPLE
49     > print jacobi(2,3), jacobi(2,5), jacobi(2,15)
50     -1 -1 1
51
52     > print jacobi(80,199)
53     1
54
55 LIMITS
56     none
57
58 LINK LIBRARY
59     NUMBER *qjacobi(NUMBER *x, NUMBER *y)
60     FLAG zjacobi(ZVALUE z1, ZVALUE z2)
61
62 SEE ALSO
63