Algosim documentation: divisors

divisors

Finds the positive divisors of an integer.

Syntax

Description

If n is a non-zero integer, then divisors(n) is the sorted list of all positive numbers that divide n.

Since every positive integer divides 0, the list of positive divisors of 0 is infinite. Therefore, divisors(0) will generate an error.

Examples

divisors(72)
1
2
3
4
6
8
9
12
18
24
36
72

See also