Detecting almost-primes quickly There are many fast algorithms (deterministic and probabilistic) for detecting primality. Are there any fast algorithms (probabilistic ones allowed) known for detecting whether a number is the product of at most two primes?
In this context, can anybody think of a property fulfilled by all or most products of two primes, but by few other numbers? (You can't explicitly use divisor sums or the Moebius function, obviously, as then the game becomes (a) trivial (b) of doubtful computational utility.)
 A: There is a survey of open problems related to factoring algorithms, Open problems in number theoretic complexity, II, by Adleman and McCurley.  It lists so many questions related to distinguishing almost primes from other composite numbers that it seems safe to infer that it is an open problem to do it quickly, and that you would either use a factoring algorithm or a related method.  For instance, computing the Mobius function as you say is a known open problem, and detecting an almost prime can be viewed as a special case of computing the Mobius function.  Because, of course, it is easy to distinguish a prime from an almost prime.
As for relevant properties, the most important relevant property of a prime $p$ is that its multiplicative group $(\mathbb{Z}/p)^\times$ is cyclic of order $p-1$.  The Miller-Rabin primality test is based on that fact.  Now, if $n = pq$ is an odd almost prime, then the multiplicative group $(\mathbb{Z}/n)^\times$ is a product of two cyclic groups. Conversely, if $(\mathbb{Z}/n)^\times$ is a product of two cyclic groups and $n$ is odd, then $n$ is a product of two prime powers.  But, there is too little control over the cardinality of this group.  In the almost prime case, it has $(p-1)(q-1)$ elements.  Even if you found the 2-torsion elements, in other words all solutions to $x^2 \equiv 1 \bmod n$, you would be able to factor $n$.
The set of almost prime numbers is an important statistical ersatz for the set of prime numbers in analytic number theory.  However, in computational number theory, no particular reason leaps out that identifying almost primes is easier than other factoring-related questions that are accepted as hard.
A: this is my answer, I don't know if this can complete your answer or not:
(similar to falagar's answer )
Let $w_i$ be the product $p_{2i}p_{2i+1}$, where $p_{i}$ is ${i}$th prime,  each $w_i$ is product of two 
distinct primes and also  $w_k$ and $w_t$ are coprime, now take $t^2$ such that $t^{2}\equiv- k\pmod{w_i}$for $k=-N\cdots 0,1,2\cdots N$,and $i=1,2,\cdots ,2N+1$ such that for $k=-N$,$i=1$ and,...,by chinese remainder theorem, we have such $t^2$.
Now $t^{2}+i$ has at least two primes because $t^{2}+i$ is multiple of $w_i$,since there are a prime between $t$ and $2t$ and also $t$ and $t/2$,so $t+h_1$
 and $t-h_2$ are primes,so at least one of the numbers $t^{2}-N,\cdots
t^{2}+1,t^{2}+2\cdots ,t^{2}+N$ is exactly product
 of two distinct primes.
