galois.divisors

galois.divisors(n)

Computes all positive integer divisors \(d\) of the integer \(n\) such that \(d\ |\ n\).

Parameters

n (int) – Any integer.

Returns

Sorted list of integer divisors \(d\).

Return type

list

Examples

In [1]: galois.divisors(0)
Out[1]: []

In [2]: galois.divisors(1)
Out[2]: [1]

In [3]: galois.divisors(24)
Out[3]: [1, 2, 3, 4, 6, 8, 12, 24]

In [4]: galois.divisors(-24)
Out[4]: [1, 2, 3, 4, 6, 8, 12, 24]