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 positive integer divisors \(d\).

Return type

List[int]

Notes

The galois.divisors() function finds all positive integer divisors or factors of \(n\), where the galois.factors() function only finds the prime factors of \(n\).

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]

In [5]: galois.factors(24)
Out[5]: ([2, 3], [3, 1])

Last update: Apr 03, 2022