Draft
Fibonacci Number
515vasekhlav
Description:
Fibonacci number (Fibonacci sequence), named after mathematician Fibonacci, is a sequence of numbers that looks like this:
0, 1, 1, 2, 3, 5, 8, 13,
You get first two starting numbers, 0 and 1, and the next number in the sequence is always the sum of the previous two numbers. Fibonacci introduced it in 1202, in his book Liber Abaci.
So what will be your task? You should write a function fib
, that takes one parameter steps
, and returns a number from the Fibonacci sequence, based on the parameter steps
, which determines the position in Fibonacci number.
For example fib(0)
returns 0
, fib(4)
returns 3
, fib(15)
returns 610
.
Similar Kata:
Stats:
Created | Apr 27, 2015 |
Warriors Trained | 2017 |
Total Skips | 161 |
Total Code Submissions | 3264 |
Total Times Completed | 515 |
JavaScript Completions | 515 |
Total Stars | 16 |
% of votes with a positive feedback rating | 89% of 144 |
Total "Very Satisfied" Votes | 120 |
Total "Somewhat Satisfied" Votes | 16 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 125 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |