Advertisement
misingnoglic

Untitled

Jan 26th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. def calkin(n):
  2.     L=[(1,1)]
  3.     for x in range(1,n+1):
  4.         for i in L:
  5.             yield (L[0]+L[1],L[1])
  6.                 yield (L[0],L[0]+L[1])
  7.             L=[(x+y,y) for (x,y) in L]+[(x,x+y) for (x,y) in L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement