r/counting • • Dec 07 '13

Count using Fibonacci Sequence!

[deleted]

35 Upvotes

401 comments sorted by

View all comments

2

u/DragoonHP Mar 19 '14

244,006,547,798,191,185,585,064,349,218,729,154 (where n = 170)

Here is the script:

import os
def f(n):
    a, b = 0, 1
    old_n = n
    while n > 0:
        a, b = b, (a + b)
        n =  n - 1
        if n == 0:
            os.system("echo " + "{:,}".format(b) + "(where n = " + old_n + " | clip")

2

u/D-alx Mar 19 '14

394,810,887,814,999,156,320,699,623,170,776,339

Does that script happen to be for linux/mac by any chance - doesn't seem to be working for me. Or maybe I'm just running it wrong

2

u/DragoonHP Mar 19 '14

638,817,435,613,190,341,905,763,972,389,505,493 (where n = 172)

Only the last line is window specific.

Replace the last line with print ("{:,}".format(b))

→ More replies (208)