Number of Prime Factors - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Number Theory : Number of Prime Factors

NumberTheory

  

NumberOfPrimeFactors

  

number of prime factors counted with multiplicity

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

NumberOfPrimeFactors(n)

NumberOfPrimeFactors(n, d)

Omega(n)

Ω⁡n

Omega(n, d)

Ω⁡n,d

Parameters

n

-

integer

d

-

(optional) option of the form distinct = true (or just distinct)

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 Ω 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 Ω⁡8.

Examples

> 

with⁡NumberTheory:

> 

NumberOfPrimeFactors⁡5

1

(1)
> 

NumberOfPrimeFactors⁡−9

2

(2)
> 

NumberOfPrimeFactors⁡12

3

(3)
> 

NumberOfPrimeFactors⁡12,distinct

2

(4)
> 

Ω⁡57

2

(5)
> 

S≔sum⁡Ω⁡f⁡i,i=1..n

S≔∑i=1n⁡Ω⁡f⁡i

(6)
> 

eval⁡S,`=`⁡f,k↦2⋅k+1,n=15

21

(7)
> 

NumberOfPrimeFactors⁡0

Error, (in NumberTheory:-NumberOfPrimeFactors) 0 has infinitely many prime factors

Compatibility

• 

The NumberTheory[NumberOfPrimeFactors] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

NumberTheory

NumberTheory[PrimeFactors]