Documentation

# `numlib`::`primedivisors`

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::primedivisors(`n`)
```

## Description

`numlib::primedivisors(n)` returns a list containing the different prime divisors of the integer `n`.

If `a` is a non-zero integer then, `numlib::primedivisors(a)` returns the sorted list of the different prime divisors of `a`.

`numlib::primedivisors(0)` returns ``.

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

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

## Examples

### Example 1

We compute the list of prime divisors of the number 6746328388800 (one of the highly composite numbers studied by S. Ramanujan in 1915):

`numlib::primedivisors(6746328388800)`
` `

## Parameters

 `n` An integer

## Return Values

`numlib::primedivisors(n)` returns a list of nonnegative integers.

## Algorithms

Internally, `ifactor` is used for factoring `n`.

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos