numlib::divisors -- divisors of
an integer
Introductionnumlib::divisors(n) returns the list of
positive divisors of n.
Call(s)numlib::divisors(n)
Parametersn |
- | integer |
Returnsnumlib::divisors returns a list of nonnegative
integers.
Related
Functionsifactor, numlib::numdivisors,
numlib::tau, numlib::primedivisors,
numlib::numprimedivisors,
polylib::divisors
Detailsa 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.
Example
1We compute the list of all positive divisors of :
>> numlib::divisors(72)
[1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72]
Example
2We compute the list of all positive divisors of :
>> numlib::divisors(-63)
[1, 3, 7, 9, 21, 63]
Backgroundifactor is used for factoring
n.