FibonacciSequence

Fibonacci sequence

Definition Certain patterns of numbers. first and second numbers are always 0,1. next number is addition of previous two numbers The List of Fibonacci numbers $0,1,1,2,3,5,8,13,21,34,55…$ Recurrence Relation $F_0=0$ $F_1=1$ $F_n=F_{n-1}+F_{n-2}$ Example index fibonacci numbers calculation 0 0 0 1 1 1 2 1 0+1 3 2 1+1 4 3 1+2 5 5 2+3 6 8 3+5 7 13 5+8 8 21 8+13 9 34 13+21 10 55 21+34 11 89 34+55 12 144 55+89 13 233 89+144 14 377 144+233 15 610 233+377 16 987 377+610 get nth fibonacci number math public static int fib(int num) { double goldenRatio = (1 + Math.