Exemplo n.º 1
0
def distinctFactors( n ):
    """
    >>> from euler47 import distinctFactors
    >>> distinctFactors(14)
    {2, 7}
    >>> distinctFactors(15)
    {3, 5}
    """
    return set( primeFactors( n ) )
Exemplo n.º 2
0
 def allTerms(limit):
     for a in range(2,limit+1):
         f= primeFactors(a)
         for b in range(2,limit+1):
             yield tuple(sorted(f*b))