Does there exist a function $f:\Bbb N\to\Bbb N$ such that \begin{align}a_{n+1}&=f(a_n)\\a_{f(n)+1}&=a_n\end{align} implies $\{a_n\}_{n\ge0}$ is a non-constant, positive integer sequence? Evidently $f$ cannot be monotonic.
If there is such a function, can all such $f$ be classified?