Hi before I reinvent the wheel, has anyone coded up the Legendre symbol (a/p)? [ If p is an odd prime number and a is an integer, then the Legendre symbol (a/p) is: * 0 if p divides a; * 1 if a is a square modulo p ? that is to say there exists an integer k such that k^2 ? a (mod p) * ?1 if not [courtesy Wikipedia] ] I might also need Jacobi's generalization of this. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743