All squarefree semiprime numbers that less than a certain number How can i find all number $N$, where $N=p*q$. (Here, $p$ and $q$ are primes and $p<q$) ?
For example: I want a formula that help me to find all $N<1000$ 

For each prime $p < \sqrt{1000}$, you take $pq$ for each prime $q$ with $p < q < 1000/p$.
EDIT:
As requested, here is some Matlab code.
A = tril(primes(500)' * primes(sqrt(1000)),-1);
sort(A(A > 0 & A < 1000)')

