What's your favorite implementation of producing the fibonacci sequence?

Posted by Terry Donaghe on Stack Overflow See other posts from Stack Overflow or by Terry Donaghe
Published on 2008-11-11T00:01:25Z Indexed on 2010/05/10 23:54 UTC
Read the original article Hit count: 234

Filed under:
|
|

Best, most creative, most clever, fastest, smallest, written in weirdest language, etc etc.

For those not familiar with this staple of programming exam question / interview question, check this out:

Fibonacci Sequence at Wikipedia

The question would be, write a simple program which will spit out the first n digits of the Fibonacci sequence.

So, if n == 12, we produce:

0 1 1 2 3 5 8 13 21 34 55 89 144

Your implementation becomes more interesting when you set n to larger values. How long does it take your implementation to return a 25 digit sequence? How about 100?

© Stack Overflow or respective owner

Related posts about fibonacci

Related posts about subjective