def ifactor(n):
    """
    The same as factor() above, but designed as a generator; this function
    should be better for massive numbers.

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