Draft

Fibonacci Number

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.

More By Author:

Check out these other kata created by vasekhlav

Stats:

CreatedApr 27, 2015
Warriors Trained2017
Total Skips161
Total Code Submissions3264
Total Times Completed515
JavaScript Completions515
Total Stars16
% of votes with a positive feedback rating89% of 144
Total "Very Satisfied" Votes120
Total "Somewhat Satisfied" Votes16
Total "Not Satisfied" Votes8
Total Rank Assessments125
Average Assessed Rank
6 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • vasekhlav Avatar
  • donaldsebleung Avatar
  • ejini战神 Avatar
Ad