galois.factors

galois.factors(x)[source]

Computes the positive factors of the integer \(x\).

Parameters

x (int) – An integer to be factored.

Returns

Sorted array of factors of \(x\).

Return type

numpy.ndarray

Examples

In [1]: galois.factors(120)
Out[1]: 
array([  1,   2,   3,   4,   5,   6,   8,  10,  12,  15,  20,  24,  30,
        40,  60, 120])