Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- sawtooth = lambda x: math.modf(x)[0]
- lg3 = math.log(5, 4)
- limit = 1
- i = 1
- m = 1
- lgt = sawtooth(lg3)
- running = True
- while running:
- try:
- while lgt >= limit:
- lgt = sawtooth(lgt + lg3)
- m += 1
- print("%d\t%d" % (i, m))
- limit = lgt
- i += 1
- except KeyboardInterrupt:
- running = False
- print("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement