def factor(n):
    """
    Returns a list of primes (excluding 1) which, when multiplied together,
    equal @n.
    NOTE: This is not the same as factors() below, which returns every whole
    number that can divide into @n evenly.
    NOTE: If @n is prime, this function returns an empty list.

    >>> factor(5)
    []
    >>> factor(34)
    [2, 17]
    >>> factor(132)
    [2, 2, 3, 11]

    AUTHORS:
    v1.0.4+             --> pydsigner
    """
    ceil = n // 2 + 1
    factors = []
    i = 2
    while i < ceil:
        nn, rem = divmod(n, i)
        if rem:
            i += 1
        else:
            n = nn
            factors.append(i)
    return factors
