5. Consider all functions $f$ from the positive integers to the positive integers such that
(i) for each positive integer $m$, there is a unique positive integer $n$ such that $f(n)=m$;
(ii) for each positive integer $n$, we have
$$
f(n+1)\text{ is either }4f(n)-1\text{ or }f(n)-1.
$$
Find the set of positive integers $p$ such that $f(1999)=p$ for some function $f$ with properties (i) and (ii).