I came across a question in codewars which is based on the calculation of the *n*th number in the Fabonacci sequence. Remember back in high school we were asked to derive this via MI, which is a long story. And thanks to the power of computation that gives options to simplify this process. Anyway, here are a few ways for solution:

1. Math function

This is put at the first place because for people who do math it is the most intuitive action to just calculate the result from $$F_n = \frac{1}{sqrt(5)}\bigg[ \big(\frac{1+sqrt(5)}{2}\big)^n - \big(\frac{1-sqrt(5)}{2}\big)^n \bigg]$$ However, the calculation

2. Recurrsion

3. Iteration

(…TBC)