def trial_division(n):
    """
    Performs trial division on an integer `n` and returns
    the prime factors of it as a list.

    :param n:
    :return: list containing the prime factors
    """
    prime_factors = []
    i = 2

    while n != 1:
        if not n % i:
            prime_factors.append(i)
            n /= i
        else:
            i += 1
    return prime_factors