numlib::divisors

Divisors of an integer

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

numlib::divisors(n)

Description

numlib::divisors(n) returns the list of positive divisors of n.

If a is a non-zero integer then numlib::divisors(a) returns the sorted list of all positive divisors of a.

numlib::divisors(0) returns [0].

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

Examples

Example 1

We compute the list of all positive divisors of 72:

numlib::divisors(72)

Example 2

numlib::divisors returns the positive divisors of negative numbers, too:

numlib::divisors(-63)

Parameters

n

Integer

Return Values

numlib::divisors returns a list of nonnegative integers.

Algorithms

Internally, ifactor is used for factoring n.

Was this topic helpful?