Algorithms: Number Theory

Algorithms: Number Theory

Explore algorithms: number theory code snippets and tutorials

Algorithms: Number Theory

Exponentiation by Squaring in PHP

Binary exponentiation evaluates an integer power using the bits of the exponent.

Algorithms: Number Theory

Trial Division Primality in PHP

A composite integer has a factor no larger than its square root.

Algorithms: Number Theory

Modular Exponentiation in Java

Modular exponentiation computes a power while reducing every intermediate product modulo m.

Algorithms: Number Theory

Least Common Multiple in Java

The least common multiple is the smallest nonnegative common multiple.

Algorithms: Number Theory

Euclidean GCD in Java

The Euclidean algorithm finds the greatest common divisor by replacing a pair with the smaller number and the remainder.