Want more features on Pastebin? Sign Up, it's FREE!
Guest

Chalsequence

By: lecram on Feb 25th, 2013  |  syntax: Python  |  size: 0.42 KB  |  views: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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()
clone this paste RAW Paste Data