def main(): cnt = 0 for term in xrange(1, 1001): num = method1(term) #print num if num_digits(num.numerator) > num_digits(num.denominator): cnt += 1 print cnt
def main(): cnt = 0 # the number of n-digit integers whic are nth power for base in range(1, 10): for exp in range(1, 30): num = pow(base, exp) if num_digits(num) == exp: #print num cnt += 1 print cnt