NumberTheory - Maple Programming Help

Home : Support : Online Help : Mathematics : Numbers : NumberTheory/NumberOfPrimeFactors

NumberTheory

 NumberOfPrimeFactors
 number of prime factors counted with multiplicity

Calling Sequence

NumberOfPrimeFactors(n)

 Omega(n) $\mathrm{\Omega }\left(n\right)$

Parameters

 n - integer

Description

 • The NumberOfPrimeFactors(n) command computes the number of prime factors of the integer n counted with multiplicity.
 • Every prime number divides 0 evenly, so 0 has infinitely many prime factors. However, for consistency with, for example, the Divisors command, NumberOfPrimeFactors(0) returns an error.
 • To determine the number of distinct prime divisors of n (that is, without respect to multiplicity), use the distinct = true (or just distinct) option.
 • Omega and $\mathrm{\Omega }$ are aliases of NumberOfPrimeFactors.
 • You can enter the command Omega using either the 1-D or 2-D calling sequence. For example, Omega(8) is equivalent to $\mathrm{\Omega }\left(8\right)$.

Examples

 > $\mathrm{with}\left(\mathrm{NumberTheory}\right):$
 > $\mathrm{NumberOfPrimeFactors}\left(5\right)$
 ${1}$ (1)
 > $\mathrm{NumberOfPrimeFactors}\left(-9\right)$
 ${2}$ (2)
 > $\mathrm{NumberOfPrimeFactors}\left(12\right)$
 ${3}$ (3)
 > $\mathrm{NumberOfPrimeFactors}\left(12,'\mathrm{distinct}'\right)$
 ${2}$ (4)
 > $\mathrm{\Omega }\left(57\right)$
 ${2}$ (5)
 > $S≔\mathrm{sum}\left(\mathrm{\Omega }\left(f\left(i\right)\right),i=1..n\right)$
 ${S}{≔}{\sum }_{{i}{=}{1}}^{{n}}{}{\mathrm{\Omega }}{}\left({f}{}\left({i}\right)\right)$ (6)
 > $\mathrm{eval}\left(S,\left[\mathrm{=}\left(f,k↦2\cdot k+1\right),n=15\right]\right)$
 ${21}$ (7)
 > $\mathrm{NumberOfPrimeFactors}\left(0\right)$

Compatibility

 • The NumberTheory[NumberOfPrimeFactors] command was introduced in Maple 2016.
 • For more information on Maple 2016 changes, see Updates in Maple 2016.