get_closest_factors

mdhelper.algorithm.utility.get_closest_factors(value: int, n_factors: int, reverse: bool = False) ndarray[int][source]

Get the \(n\) closest factors for a given number \(N\), sorted in ascending order.

Parameters:
valueint

Number \(N\) to be factorized.

n_factorsint

Number of factors \(n\) to return.

reversebool, optional, default: False

Specifies whether to sort in descending order.

Returns:
factorsnp.ndarray

\(n\) closest factors for N.

Shape: \((n,)\).