def factorize(n):
    """Returns list of prime factors of positive integer n."""
    i = 2
    factors = []
    while True:
        q, r = divmod(n, i)
        if r:
            i += 1
            if i > n:
                return factors
        else:
            factors.append(i)
            if q < i:
                return factors
            n = q