def next(expansion): un = fraction(1,1) expansion += un expansion.inverse() expansion += un return expansion
def prop(expansion): na = digitNumber(expansion.a) nb = digitNumber(expansion.b) if na > nb: return True return False # ****************************************************************************** startTime = time() expansion = fraction(3,2) i = 1 total = 0 while i <= 1000: if not i % 10: print('.', end='', flush=True) test = prop(expansion) # print(i, expansion, test) if test: total += 1 expansion = next(expansion) i += 1