Skip to main content

Fibonacci Number

Definition​

The Fibonacci number algorithm generates a sequence of numbers known as the Fibonacci sequence, where each number is the sum of the two preceding ones, starting with 0 and 1

Practice​

fibonacci(n):
if n <= 1:
return n
else:
return fibonacci(n - 1) + fibonacci(n - 2)