number-theory

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.

Members

(static, constant) egcd

Description:
  • Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.
Source:
See:
Extended Euclidean Algorithm. Computes the greatest common divisor (GCD) of a and b, and the coefficients of Bézout's identity.

(static, constant) factors

Description:
  • Calculates the prime factorization of a number.
Source:
See:
Calculates the prime factorization of a number.

(static, constant) factorsBI

Description:
  • Calculates the prime factorization of a BigInt.
Source:
See:
Calculates the prime factorization of a BigInt.

(static, constant) gcd

Description:
  • Calculates the Greatest Common Divisor (GCD) of two numbers.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two numbers.

(static, constant) gcdBI

Description:
  • Calculates the Greatest Common Divisor (GCD) of two BigInts.
Source:
See:
Calculates the Greatest Common Divisor (GCD) of two BigInts.

(static, constant) lcm

Description:
  • Calculates the Least Common Multiple (LCM) of two numbers.
Source:
See:
Calculates the Least Common Multiple (LCM) of two numbers.

(static, constant) lcmBI

Description:
  • Calculates the Least Common Multiple (LCM) of two BigInts.
Source:
See:
Calculates the Least Common Multiple (LCM) of two BigInts.

(static, constant) lucasLehmerBI

Description:
  • Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.
Source:
See:
Calculates whether a given Mersenne number (2^p - 1) is prime using the Lucas-Lehmer primality test.

(static, constant) mobius

Description:
  • Calculates the Mobius function μ(n) of a number.
Source:
See:
Calculates the Mobius function μ(n) of a number.

(static, constant) mobiusBI

Description:
  • Calculates the Mobius function μ(n) of a BigInt.
Source:
See:
Calculates the Mobius function μ(n) of a BigInt.

(static, constant) mod

Description:
  • Calculates the modulo of two numbers (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two numbers (Python-like behavior for negative numbers).

(static, constant) modBI

Description:
  • Calculates the modulo of two BigInts (Python-like behavior for negative numbers).
Source:
See:
Calculates the modulo of two BigInts (Python-like behavior for negative numbers).

(static, constant) phi

Description:
  • Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.
Source:
See:
Euler's Totient Function (Phi). Counts the positive integers less than or equal to n that are relatively prime to n. Uses Euler's product formula based on prime factorization.

(static, constant) phiBI

Description:
  • Euler's Totient Function (Phi) - BigInt version.
Source:
See:
Euler's Totient Function (Phi) - BigInt version.

(static, constant) powMod

Description:
  • Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a number. Similar to Python's pow(base, exponent, modulus).

(static, constant) powModBI

Description:
  • Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).
Source:
See:
Calculates the power of a base to an exponent, optionally modulo a BigInt. Similar to Python's pow(base, exponent, modulus).

(static, constant) tonelliShanksBI

Description:
  • Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.
Source:
See:
Computes the modular square root of n modulo p using the Tonelli-Shanks algorithm. Solves the congruence r^2 = n (mod p) where p is an odd prime.