TL;DR; Fix your formula.
I do not know what you're doing here, but something is clear: your recursion will blow up.
Your function f() seems to be used in recursion. This means it must have usually 2 paths: one, to keep calling itself (recursion) and one for termination.
Your termination condition is n to be <= 3.
However, in the recursion part, you keep increasing n for the next iteration by 2.
It's easy to see that your recursion will never terminate (for n > 3 start values) as then n just keeps growing and growing and never reaches the termination condition, i.e. to be <= 3. (Note, it actually reaches the termination condition after n overflows.)