The Fibonacci sequence is a famous set of numbers in mathematics. Discovered between 450 B.C. and 200 B.C. by Indian mathematicians trying to enumerate poetic syllables, and late by Leonardo of Pisa for counting rabbits around 1200 A.D.
{1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...}
The sequence is constructed by adding the two previous numbers to get the next number. The first two numbers in the sequence are always 1.
A recursive method is a method that continuously calls itself until it encounters a base case.
Recursion:
Talk about recursive vs. iterative
Create a recursive method, called fibonacciNumber, that calculates the target fibonacci number.
The Fibonacci sequence also creates an interesting rectangle, as shown in the figure below:
Using your fibonacciNumber() method, calculate the area of the rectangle of the target fibonacci number.
Using your fibonacciNumber() method, calculate the perimeter of the rectangle of the target fibonacci number.
Something about why using recursion is bad for extra 2 and 3
