factor [math]
— Function File: p = factor (q)
— Function File: [p, n] = factor (q)

Return prime factorization of q. That is, prod (p) == q and every element of p is a prime number. If q == 1, returns 1.

With two output arguments, return the unique primes p and their multiplicities. That is, prod (p .^ n) == q.

See also: gcd, lcm