I think Riemann Hypothesis is related to the size of the fractional part of your formula. RH implies: $$ \pi(x) > li(x) -\sqrt{x}\log{x}/(8 \pi) \text{ if } 2657 \le x \qquad (1)$$ Suppose your formula holds and write $$ \lfloor \log{n} -\frac12 \rfloor = \log{n} -\frac12 - \alpha \qquad (2) $$ where $\alpha$ is the fractional of $\log{n} -\frac12$ Suppose $ 0 < \alpha \le \frac12$, substitute your formula and (2) in (1) and compute the limit at infinity. According to both Maple and Wolfram alpha the limit at infinity violates RH, so RH implies $\alpha > \frac12$ whenever your formula holds and $n$ is large enough. OEIS A057809 Numbers n such that pi(n) divides n has 296 entries, the larges of which is $75370126416$. $\alpha \le \frac12$ happens only 14 times ending at $a(n)=1092$.