Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 479 Bytes

(7 kyu) Recursion 2 - Fibonacci.md

File metadata and controls

21 lines (13 loc) · 479 Bytes

Recursion #2 - Fibonacci (7 kyu)

https://www.codewars.com/kata/recursion-number-2-fibonacci/

2 - Fibonacci number

In mathematical terms, the sequence f(n) of fibonacci numbers is defined by the recurrence relation

f(n) = f(n-1) + f(n-2)

with seed values

f(1) = 1 and f(2) = 1

Your task

You have to create the function fibonacci that receives n and returns f(n). You have to use recursion.