Let $f(x,p) = $ the number of integers $i$ where $0 < i \le x$ and lpf($i)>p$ where lpf($i)$ is the least prime factor of $i$.
I believe that the exact answer is captured by this:
$$f(x,p) = \sum_{d | p\#}\mu(d)\left\lfloor\frac{x}{d}\right\rfloor$$
Unfortunately, the above equation is very hard to work with.
An approach that seems preferable is this:
$$f(x,p) = \left\lfloor\left(\prod_{q|p\#}\frac{q-1}{q}\right)x\right\rfloor - err(x)$$
where $err(x)$ is an error term.
Does this make sense for prime counting? If so, what would be the standard way to estimate the upper bound of the error term?
I would greatly appreciate it if someone could provide an example of estimating the error term or provide a reference to an article where the error term is estimated.