Consider a subset $A$ of the natural numbers analogous to the primes (but rarer). Let $a_n$ denote the $n$th element of $A$, and $a(n)$ denote the number of elements of $A$ less than or equal to $n$ (analogous to $p_n$ and $\pi(n)$ respectively).
Define $$b(n)=\sum_{a \le n}\log a$$ where the sum is taken over those elements of $A$ less than or equal to $n$ and $\log$ denotes the natural logarithm, analogous to Chebyshev's theta function $\vartheta(x)$. What in general is the relationship between $b(n)$ and $a(n)$? Specifically, if we know that $$b(n)\gg \log n \tag{$*$}$$ what bounds can we place on $a(n)$?
I have been unable to come up with a method for this other than plugging in various approximations to $a(n)$ and testing which are compatible with $(*)$. Guessing from the case $A=\mathbf P$ of the primes, I hazard that when given $(*)$ $a(n) \gg {\sqrt n\over \log n}$, which seems to work reasonably well, but I am not confident in my calculations and even if they are correct this may not be the most accurate answer.