5

E.g., there are $4$ semiprimes less than or equal to $10$ $(4, 6, 9, 10)$ or $2$ squarefree semiprimes ($6$ and $10$).

It's ok if it's off for small numbers but gets more accurate as $n \to \infty$.

Mathphile
  • 2,437

2 Answers2

7

Asymptotically there are about $n\frac{\log\log n}{\log n}$ semiprimes up to $n$, almost all of which are squarefree.

There's also an exact formula if you know all the primes up to the square root of $n$: $$ -{\pi\left(\sqrt{n}\right)\choose 2}+\sum_{p^2\le n} \pi\left(\frac{n}{p}\right) $$ for all semiprimes, or $$ -{\pi\left(\sqrt{n}\right)\choose 2}-\pi\left(\sqrt{n}\right)+\sum_{p^2\le n} \pi\left(\frac{n}{p}\right) $$ for the squarefree semiprimes only.

Charles
  • 32,122
  • Where did you find the exact formulas? Also do you happen to know if they can be extended to numbers of the form $n=p_1p_2p_3$ squarefree? – AvatarOfChronos Feb 01 '15 at 15:29
  • @AvatarOfChronos: I expect they can be so extended, yes -- but the resulting formulas would probably be pretty complex, combinatorially speaking. – Charles Feb 02 '15 at 14:32
  • Thanks for replying I actually created a separate question about this and later posted a solution to it after some research. It wasn't as clean as these functions but it did the job. – AvatarOfChronos Feb 02 '15 at 22:57
3

Yes, that can be done.

Redesignate the prime counting function as $p_1(x)$, which counts how many numbers between 0 and $x$ have one prime factor (provided $x$ is a nonnegative real number). Then, given $k \in \mathbb{Z}^+$, we have $$\pi_k(x) \sim \frac{x}{\log x} \frac{(\log \log x)^{k - 1}}{(k - 1)!}.$$ Setting $k = 2$ gives us $$\pi_2(x) \sim \frac{x \log \log x}{\log x}.$$ This comes from Landau's Handbuch der Lehre von der Verteilung der Primzahlen. It is way off at first, it says there are $-2$ semiprimes between 0 and 2.

Robert Soupe
  • 14,663