If I have a function that recurses on fibonacci numbers, can I determine how many times it recurses?

18 Views Asked by At

Lets say I have the following function:

function fib(n) {
    if (n <= 1) return n;
    return fib(n - 1) + fib(n - 2); 
}

For $n = 5$, it calls itself $14$ times. For $n = 4$, it calls itself $8$ times.

Is there a formula to figure out how many times it will recurse for any $n$?