Skip to content

Instantly share code, notes, and snippets.

@dnase
Created August 28, 2014 01:55
Show Gist options
  • Select an option

  • Save dnase/f372aeea4203762afef3 to your computer and use it in GitHub Desktop.

Select an option

Save dnase/f372aeea4203762afef3 to your computer and use it in GitHub Desktop.
def sequence_gen(n):
ret = 0
i = 0
while i < n:
yield ret
ret = ((ret**2) + 45) % 1000000007
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment