...

/

Challenge 3: The nth Fibonacci Number

Challenge 3: The nth Fibonacci Number

Given an index, find the nth Fibonacci number.

Problem Statement

Implement a function that takes a variable testVariable and finds the number that is placed at that index in the Fibonacci sequence.

What is the Fibonacci Sequence?

The Fibonacci sequence is one of the most famous sequences in mathematics. Each number in the sequence is the sum of the two numbers that precede it.

So, the sequence goes:

$ 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 … $

Indexing starts at 00. Therefore, at index 00 we have the element 00, at index 11 we have the element 11, at index 22 we have the element 11, and so on.

Generic Mathematical Notation of Fibonacci Sequence

Any number, at index nn in the series, can be calculated using the following equation:

FFn =F=Fn-2+F+F ...