Number Theory¶
28 built-in function(s) in this category.
ContinuedFraction— ContinuedFraction[x, n] (Stable)CoprimeQ— CoprimeQ[n1, n2, ...] (Stable)Divisible— Divisible[n, m] (Stable)DivisorSigma— DivisorSigma[k, n] gives the divisor function sigma_k(n), the sum of the k-th powers of the divisors of n. DivisorSigma[k, n, GaussianIntegers -> True] sums over Gaussian-integer divisors. (Stable)Divisors— Divisors[n] gives a list of the integers that divide n. Divisors[n, GaussianIntegers -> True] includes Gaussian-integer divisors. (Stable)EulerPhi— EulerPhi[n] gives the Euler totient function phi(n). (Stable)ExtendedGCD— ExtendedGCD[n1, n2, ...] (Stable)FactorInteger— FactorInteger[n] gives a list of the prime factors of the integer n, together with their exponents. (Stable)FromContinuedFraction— FromContinuedFraction[{a1, a2, ..., an}] (Stable)GCD— GCD[n1, n2, ...] (Stable)IntegerPartitions— IntegerPartitions[n] (Stable)JacobiSymbol— JacobiSymbol[n, m] (Stable)LCM— LCM[n1, n2, ...] (Stable)LiouvilleLambda— LiouvilleLambda[n] gives the Liouville function lambda(n) = (-1)^Omega(n), where Omega(n) counts the prime factors of n with multiplicity. Completely multiplicative. A non-real Gaussian-integer argument, or GaussianIntegers -> True, is handled over Z[i]. (Stable)MoebiusMu— MoebiusMu[n] gives the Moebius function mu(n): 0 if n has a squared prime factor, otherwise (-1)^k where k is the number of distinct primes. A non-real Gaussian-integer argument is handled over Z[i]. (Stable)MultiplicativeOrder— MultiplicativeOrder[k, n] (Stable)NextPrime— NextPrime[x] gives the next prime after x. (Stable)PartitionsP— PartitionsP[n] (Stable)PartitionsQ— PartitionsQ[n] (Stable)PowerMod— PowerMod[a, b, m] gives a^b mod m. (Stable)Prime— Prime[n] gives the nth prime number. Listable. Small n is read from a sieve table; large n inverts PrimePi via an asymptotic estimate refined against the exact prime counter. Defined for positive integers up to n ~ 1.4*10^12; non-positive-integer arguments give Prime::intpp. (Stable)PrimeNu— PrimeNu[n] gives the number of distinct prime factors of n, nu(n). PrimeNu[n, GaussianIntegers -> True] (or a non-real Gaussian-integer n) counts distinct Gaussian prime factors over Z[i]. PrimeNu[1] is 0; PrimeNu[0] is left unevaluated. (Stable)PrimeOmega— PrimeOmega[n] gives the number of prime factors of n counted with multiplicity, Omega(n). PrimeOmega[n, GaussianIntegers -> True] (or a non-real Gaussian-integer n) counts Gaussian prime factors over Z[i]. PrimeOmega[1] is 0; PrimeOmega[0] is left unevaluated. (Stable)PrimePi— PrimePi[x] gives the number of primes less than or equal to x, exact for x up to 5*10^13 (larger x is left unevaluated). The option Method -> m selects the algorithm: Automatic (default), "Sieve", "Legendre", "Meissel", "Lehmer", "LMO" (Lagarias-Miller-Odlyzko), "DelegliseRivat", or "LucyHedgehog". (Stable)PrimeQ— PrimeQ[n] (Stable)PrimitiveRoot— PrimitiveRoot[n] (Stable)PrimitiveRootList— PrimitiveRootList[n] (Stable)SquareFreeQ— SquareFreeQ[expr] (Stable)