 NumberTheory - Maple Programming Help

Home : Support : Online Help : Mathematics : Numbers : Prime : NumberTheory/PrimeFactors

NumberTheory

 PrimeFactors
 prime factors of an integer

 Calling Sequence PrimeFactors(n)

Parameters

 n - integer

Description

 • The PrimeFactors(n) command computes the prime factors of the integer n.
 • Every prime number divides 0 evenly, but one cannot represent the set of all prime numbers as an enumerated set. Therefore, PrimeFactors(0) returns an error.

Examples

 > $\mathrm{with}\left(\mathrm{NumberTheory}\right):$
 > $\mathrm{PrimeFactors}\left(3526\right)$
 $\left\{{2}{,}{41}{,}{43}\right\}$ (1)
 > $\mathrm{PrimeFactors}\left(55557\right)$
 $\left\{{3}{,}{6173}\right\}$ (2)
 > $\mathrm{PrimeFactors}\left(-57\right)$
 $\left\{{3}{,}{19}\right\}$ (3)
 > $\mathrm{plots}:-\mathrm{pointplot}\left(\mathrm{union}\left(\mathrm{seq}\left(\mathrm{map}\left(p→\left[n,p\right],\mathrm{PrimeFactors}\left(n\right)\right),n=1..1000\right)\right)\right)$ > $\mathrm{PrimeFactors}\left(0\right)$

Compatibility

 • The NumberTheory[PrimeFactors]  command was introduced in Maple 2016.