[Computer scientist here who is not totally familiar with the factoring literature -- please forgive my ignorance.]
It's well known that hard-to-factor integers, $n$, are typically semi-primes, such that their factors are roughly $O(\sqrt{n})$ in size. However, it's not clear to me that all such semi-primes are necessarily hard (maybe there are algorithms which succeed on some, but not all such instances).
My question is, if I enumerate through the integers $1,2,3,...$ etc., how frequently do these hard-to-factor instances occur? I'm interested in both the case where we are only concerned with semi-primes, but also any other hard-to-factor cases, and how frequently they occur. Is it true that all semi-primes with $\sim O(\sqrt{n})$ factors are hard to factor?
I would be particularly interested to know if I can take an interval of intergers $[2^k, 2^k + p(k)]$ for some sufficiently large polynomial $p$, for each $k\in \mathbb{N}$, such that I'm highly likely to run into $poly(k)$-many hard instances. Or equivalently, given an interval $[x, x + w]$ for some $w$, can I lower-bound the number of hard instances I expect to find?
Edit: More generally, given an integer $k$ is there a way of selecting selecting $poly(k)$ many integers with values between $(2^k, 2^{k+1})$ which are hard to factor*. The case above for $[2^k, 2^k + p(k)]$ would give an example of this, as one could state at $2^k$ and simply enumerate up to $2^k+poly(k)$ and we would get a set of integers, which (hopefully) at least $poly(k)$ many would be hard-to-factor.
*If necessary, we can allow that this occurs with high probability.