serret: serret(p) expresses a prime of the formĤn+1 as the sum of two squares using Serret's algorithm.
Residue a mod p, using an algorithm of Rene Peralta. peralta(a,p) finds a square root of a quadratic.jacobi(m,n) calculates the Jacobi symbol.euclid1: euclid(m,n) returns the length of Euclid's algorithm.euclid: euclid(m,n) performs Euclid's algorithm.euclid0: euclid0(m,n) performs Euclid's algorithm and finds the partial quotients and convergents for the continued fraction of m/n, n> 0.bezout1(a,b) deals with arbitrary integers a and b. bezout(a,b), when a and b are non-negative, returns d = gcd(a,b) = globalu*a + globalv*b, where globalu and globalv are global variables.ceiling(a,b): returns least integer x>= a/b.binomial(n,m): returns the binomial coefficient.mthrootr(a,b,m,r): this gives the mth-root of a/b.Matthews, Computing mth roots, College Mathematics Journal 19 (1988) 174-176.) Here a,b and m are positive integers, m > 1. mthroot(a,b,m): returns the integer part of the mth-root of a/b.chineseb(a,b,m,n): solves ax ≡ b(mod m),.gcda(m,n): finds gcd(m.,m) and expresses itĪs a linear combination of m.,m.chinese(a,b,m,n): solves x ≡ a(mod m) and x ≡ b(mod n).inv(a,n): returns the inverse of a mod m.int(a,b): returns the integer part of a/b, b nonzero.They may contain bugs, both on the algorithmic and programming side. These are downloadable as a gzipped tar file.