def distinctFactors( n ): """ >>> from euler47 import distinctFactors >>> distinctFactors(14) {2, 7} >>> distinctFactors(15) {3, 5} """ return set( primeFactors( n ) )
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))