Coding the Fibonacci Sequence

Recent post as DoD (Director of Development – not Department of Defense) for ACLTC Ruby Bootcamp:

The Fibonacci Sequence.

You start with two numbers – 0 and 1 – you add them together, and then you keep adding the last two numbers in your list to get the next number.

0 + 1 = 1, 1 + 1 = 2, 1 + 2 = 3, 3 + 2 = 5, and so on.

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6785, 10946, 17711, 28657, 46368, 75025…

…ahem.  Sorry…got carried away there.

It’s easy to do when you don’t have to add the numbers yourself.

Just write a computer program to do it for you. Easy! Take 60 seconds.

Continue reading “Coding the Fibonacci Sequence”