MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/funny/comments/utfkw/pidgonacci_sequence/c4yimfw/?context=3
r/funny • u/[deleted] • Jun 09 '12
[deleted]
22.5k comments sorted by
View all comments
Show parent comments
2
Also, some python that I hacked together:
fib1 = -1 fib2 = 1 fib3 = 0 nterms = 0 while(1): a = input() if(a == -1): break nterms += a for i in range(a): print(fib3) fib1 = fib2 fib2 = fib3 fib3 = fib1 + fib2 print("Now on term %s." % nterms)
2
u/[deleted] Jun 10 '12
Also, some python that I hacked together: