Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 212 Bytes

fibonacci.md

File metadata and controls

15 lines (12 loc) · 212 Bytes

Fibonacci-Folge wikipedia

0,1,1,2,3,5,8,13
0+1,1+1,1+2,2+3,3+5,5+8

Ruby

def fib(n)
  return n if n < 2
  return fib(n- 1) + fib(n - 2)
end