7 kyu

Recursion #2 - Fibonacci

Description:

Do you know recursion?
This is a kata series that you can only solve using recursion.

##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.

Fundamentals
Recursion
Mathematics

More By Author:

Check out these other kata created by gabrielsiedler

Stats:

CreatedJan 12, 2016
PublishedJan 12, 2016
Warriors Trained4380
Total Skips84
Total Code Submissions7031
Total Times Completed3135
JavaScript Completions3135
Total Stars50
% of votes with a positive feedback rating92% of 466
Total "Very Satisfied" Votes401
Total "Somewhat Satisfied" Votes57
Total "Not Satisfied" Votes8
Ad
Contributors
  • gabrielsiedler Avatar
  • myjinxin2015 Avatar
Ad