def factorize(n):
    """Return prime factorization of n as sorted list"""
    d = 2
    factors = []
    while n > 1:
      if n % d == 0:
        factors.append(d)
        n = n/d
      else:
        d = d + 1
    return factors