Skip to content

Instantly share code, notes, and snippets.

@saxbophone
Created July 30, 2015 16:05
Show Gist options
  • Select an option

  • Save saxbophone/2a7dd699d34f0670b23a to your computer and use it in GitHub Desktop.

Select an option

Save saxbophone/2a7dd699d34f0670b23a to your computer and use it in GitHub Desktop.
Python Sequence theory generator
def sequence(i):
store = (i + 1) * (i / 2)
while True:
yield store
store = (store + 1) * (store / 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment