def prime_factors(number):
    """Finds prime factors of an integer (by trial-division).

    :param number: The integer to factor
    :type number: int

    :rtype: list of ints

    **Examples**

    >>> prime_factors(314)
    [2, 157]

    >>> prime_factors(31)
    [31]
    """
    factor = 2
    factors = []
    while factor * factor <= number:
        if number % factor:
            factor += 1
        else:
            number //= factor
            factors.append(factor)
    if number > 1:
        factors.append(number)

    return factors