Let $f(n)$ and $g(n)$ be functions satisfying
\[f(n) = \begin{cases}\sqrt{n} & \text{ if } \sqrt{n} \text{ is an integer}\\ 1 + f(n+1) & \text{ otherwise} \end{cases}\]and
\[g(n) = \begin{cases}\sqrt{n} & \text{ if } \sqrt{n} \text{ is an integer}\\ 2 + g(n+2) & \text{ otherwise} \end{cases}\]for positive integers $n$. Find the least positive integer $n$ such that $\tfrac{f(n)}{g(n)} = \tfrac{4}{7}$.
Consider what happens when we try to calculate $f(n)$ where n is not a square. If $k^20, k>10$. The LHS expression is always even (since $3k^2+k-10$ factors to $k(3k+1)-10$, and one of $k$ and $3k+1$ will be even), so to ensure that $k$ and $n$ share the same parity, $k$ should be even. Then the least $k$ that satisfies these requirements is $k=16$, giving $n=258$.
Indeed - if we check our answer, it works. Therefore, the answer is $\boxed{258}$.
-Ross Gao