Conway's $1(0),000 challenge
JavaScript (ES6), 83 bytes
Slow as hell.

g=n=&gt;n&lt;3||g(n-g(--n))+g(g(n))
f=(r,n=1,m)=&gt;(x=g(n)*2-n)|m?f(r,n+1,x&lt;r*n?x&amp;&amp;m:o=n):o

Try it online!
How?
We look for the highest \$n\$ such that:
$$2\cdot a(n)-n \ge r\cdot n$$
We stop when no greater value is found in a whole interval:
$$[2^k+1,2^{k+1}], k&gt;0$$
whose upper bound is characterized by \$2\cdot a(n)-n=0\$.

JavaScript (ES6), 94 bytes
A much faster version using a cache to prevent too many recursive calls.

g=n=&gt;g[n]=g[n]||n&lt;3||g(n-g(--n))+g(g(n))
f=(r,n=1,m)=&gt;(x=g(n)*2-n)|m?f(r,n+1,x&lt;r*n?x&amp;&amp;m:o=n):o

Try it online!