FactorInteger
gives a list of the prime factors of the integer n, together with their exponents.
FactorInteger[n,k]
does partial factorization, pulling out at most k distinct factors.
Details and Options
- FactorInteger is also known as prime factorization.
- For a positive number n=p1k1⋯ pmkm with pi primes, FactorInteger[n] gives a list {{p1,k1},…,{pm,km}}.
- For negative numbers, the unit {-1,1} is included in the list of factors.
- FactorInteger also works on rational numbers. The prime factors of the denominator are given with negative exponents.
- FactorInteger[n,GaussianIntegers->True] factors over Gaussian integers.
- FactorInteger[m+I n] automatically works over Gaussian integers.
- When necessary, a unit of the form {-1,1}, {I,1} or {-I,1} is included in the list of factors.
- The last element in the list FactorInteger[n,k] gives what is left after the partial factorization.
- FactorInteger[n,Automatic] pulls out only factors that are easy to find.
- FactorInteger uses PrimeQ to determine whether factors are prime.
Examples
open allclose allBasic Examples (2)
Scope (6)
FactorInteger works over integers:
FactorInteger threads over lists:
Applications (12)
Basic Applications (5)
Every positive integer can be represented as a product of prime factors:
Plot the number of distinct prime factors of numbers up to :
Compare with the number of distinct prime factors over the Gaussian integers:
Display as an explicit product of factors:
Use FactorInteger to test for prime powers:
Use FactorInteger to find all prime divisors of a number:
Number Theory (7)
Use FactorInteger to compute the number of divisors of the number:
Use FactorInteger to recognize powerful numbers, numbers whose prime factors are all repeated:
Find factorizations of numbers of the form :
Find all natural numbers up to 100 that are primes or prime powers:
The highest power of a prime in numbers up to 100:
Find primes that appear in prime factorization of only to the first power:
Use FactorInteger to compute the square-free part of a number:
Properties & Relations (9)
The prime factorization of a prime number is itself:
Composite numbers have at least two prime factors including multiplicities:
Compute the original number from a factorization:
Exponents in the prime factorization of a square-free number are all :
Divisors gives the list of divisors including prime divisors:
PrimeNu gives the number of distinct prime factors:
PrimeOmega gives the number of prime factors counting multiplicities:
Coprime numbers have no prime factors in common:
If the prime factorization of n is given by , then the number of divisors of n is :
Possible Issues (2)
Text
Wolfram Research (1988), FactorInteger, Wolfram Language function, https://reference.wolfram.com/language/ref/FactorInteger.html (updated 2007).
CMS
Wolfram Language. 1988. "FactorInteger." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/FactorInteger.html.
APA
Wolfram Language. (1988). FactorInteger. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FactorInteger.html