def mod_sqrt_fact_eratosthenes_sieve(n):
    """
    Something like a sieve of Eratosthenes for factorization - 1
    Complexity: O(sqrt(N))

    We can find all the factors of a number using a simple
    alternation to the Eratosthenes sieve. Factors are the
    numbers you multiply to get another number. Those numbers
    can be written as prime only numbers. Why? Lets take the
    number 20 for example. Its factors are 4 and 5, or 2 and 10
    etc. All of these can be written as 2 * 2 * 5 though, which
    is unique. It becomes obvious that every non prime number
    can be written as the multiplication of primes. As already
    stated if n is non prime then there is a prime that divides
    it and p^2 <= n and that's the reason why we loop only up
    to sqrt(n). We basically find the minimum prime that divides
    our number. When we find it, we divide the number by that
    prime and we continue the same process.
    """
    factorial = []
    for i in range(2, int(n**0.5) + 1):
        while n % i == 0:
            factorial.append(i)
            n //= i

    if n != 1:
        factorial.append(n)

    return factorial