Calculates Fibonacci sequence to the nth number