r/funny • • Jun 09 '12

Pidgonacci Sequence

Post image

[deleted] — view deleted post

1.5k Upvotes

22k comments sorted by

View all comments

Show parent comment

1

u/baijuke Jun 10 '12 edited Jun 10 '12

I'm out. Good luck!

f = open("fib", "w")

a, b = 1, 1
curr = 2
while (1):
    curr += 1
    b, a = (a + b, b)
    print curr
    f.write("F(%d) = %d\n" % (curr, b))
    f.flush()
f.close()

And in bash for easy copy-pasting:

I=2438; while true; do; grep F($I) fib | xclip -selection clip ; echo $I; read; I=$((I+1)); done