Recurrence relation with random number?

I got:


We can arbitrary set $a_{1}$ and $a_{2}$.

And we don’t know what a formula $f(x)$ represents, but always know the return value of it. Please consider it as a sort of black boxes which gives us a random number corresponding to x.

And, at last, I want the general term of the sequence $a_{n}$. Or whether it just can be solved or not.

I know how to solve when the f(x) is a constant or a polynomial, but not this one.

Please help me.