Skip to content

find_close_factors

Source code in tinybig/koala/algebra/numbers.py
def find_close_factors(n: int):
    sqrt_n = int(math.isqrt(n))
    for i in range(sqrt_n, 0, -1):
        if n % i == 0:
            return i
    return None