# Number Theory

Modular arithmetic operations and sequences of numbers

You can perform elementary number-theoretic operations to find the LCM, GCD, modulus, quotient, and remainder. You also can find prime numbers, and special sequences of numbers, such as harmonic, Bernoulli, and Euler numbers.

## Functions

expand all

 `divisors` Divisors of integer or expression `factorIntegerPower` Perfect power factoring `gcd` GCD of numbers and polynomials `isPrimitiveRoot` Determine which array elements are primitive roots (Since R2020a) `lcm` Least common multiple `max` Maximum elements of symbolic input (Since R2021a) `min` Minimum elements of symbolic input (Since R2021a) `mod` Symbolic modulus after division `powermod` Modular exponentiation `quorem` Quotient and remainder `rem` Remainder after division
 `bernoulli` Bernoulli numbers and polynomials `euler` Euler numbers and polynomials `fibonacci` Fibonacci numbers `harmonic` Harmonic function (harmonic number) `rat` Rational fraction approximation (continued fraction) (Since R2020a)
 `nextprime` Next prime number `nthprime` nth prime number `prevprime` Previous prime number
 `eulerPhi` Euler phi function (Since R2020a) `jacobiSymbol` Jacobi symbol (Since R2020a)