To handle this you need to computer the values f(3), f(4), f(5), ... f(i). Do this in a loop. Keep the previous 2 results in local variables, let's call then f1 and f2, then at each step you have result = f1+f2 and then you have to update f1 and f2 for the next step.
If you do it right it will be about 5 lines of code.