Skip to content

Instantly share code, notes, and snippets.

@faruken
Created December 21, 2017 11:42
Show Gist options
  • Save faruken/987527bc5599afe079fdfcfabe4c1579 to your computer and use it in GitHub Desktop.
Save faruken/987527bc5599afe079fdfcfabe4c1579 to your computer and use it in GitHub Desktop.
lol fibonacci
def fibonacci(n):
i = 1
while (((i & 0xffff0000) >> 16) + (i & 0xffff) <= 0xffff):
print '%d' % (i & 0xff),
i = ((i & 0xffff) << 16) | ((i >> 16) + (i & 0xffff))
if __name__=='__main__':
fibonacci(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment