Exemple #1
0
def abundant( source ):
    """Filter a source for abundant numbers.
    >>> from euler23 import abundant
    >>> list(abundant( (11, 12, 13) ))
    [12]
    """
    return ( i for i in source if sum(properDivisors(i)) > i )
Exemple #2
0
def abundant2( source ):
    """Filter a source for abundant numbers.
    >>> from euler23 import abundant2
    >>> list(abundant2( (11, 12, 13) ))
    [12]
    """
    for i in source:
        if sum(properDivisors(i)) > i:
            yield i