numlib::numprimedivisors

Number of prime factors of an integer

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

numlib::numprimedivisors(n)

Description

numlib::numprimedivisors(n) returns the number of prime factors of the integer n, counted without multiplicity.

numlib::numprimedivisors(0) returns 0.

numlib::numprimedivisors returns the function call with evaluated argument if the argument is not a number.

numlib::numprimedivisors returns an error if the argument evaluates to a number of wrong type.

numlib::numprimedivisors and numlib::omega are equivalent.

Examples

Example 1

Compute the number of primes dividing 6746328388800:

numlib::numprimedivisors(6746328388800)

Parameters

n

An integer

Return Values

numlib::numprimedivisors(n) returns a nonnegative integer.

Algorithms

Internally, ifactor is used for factoring n.