SHARE
TWEET

Chalsequence

lecram Feb 25th, 2013 30 Never
  1. m = n = 1
  2. num = 3
  3. den = 2
  4. limit = 2
  5. i = 1
  6. running = True
  7. while running:
  8.     try:
  9.         den2 = den * 2
  10.         while num > den2:
  11.             n += 1
  12.             den = den2
  13.             den2 = den * 2
  14.         t = num / den
  15.         if t < limit:
  16.             print(i, m, sep='\t')
  17.             limit = t
  18.             i += 1
  19.         m += 1
  20.         num *= 3
  21.     except KeyboardInterrupt:
  22.         running = False
  23. print()
RAW Paste Data
Top