Euler Problem 187
=================

A composite is a number containing at least two prime factors. For example, 15 = 3 × 5; 9 = 3 × 3; 12 = 2 × 2 × 3.

There are ten composites below thirty containing precisely two, not necessarily distinct, prime factors: 4, 6, 9, 10, 14, 15, 21, 22, 25, 26.

How many composite integers, n < 10<sup>8</sup>, have precisely two, not necessarily distinct, prime factors?



```python
from sympy import sieve, primepi
print(sum(primepi(10**8 / p) - i for i, p in enumerate(sieve.primerange(1, 10**4))))
```

    17427258



```python

```

bb16b86c34b83e5b20f614b579ee211f65d9d037
ipynb
Jupyter Notebook
Euler 187 - Semiprimes.ipynb
Radcliffe/project-euler
5eb0c56e2bd523f3dc5329adb2fbbaf657e7fa38
MIT
2016-05-11T18:55:35.000Z
2019-12-27T21:38:43.000Z
Euler 187 - Semiprimes.ipynb
Radcliffe/project-euler
5eb0c56e2bd523f3dc5329adb2fbbaf657e7fa38
MIT
Euler 187 - Semiprimes.ipynb
Radcliffe/project-euler
5eb0c56e2bd523f3dc5329adb2fbbaf657e7fa38
MIT
Qwen/Qwen-72B
1. YES
2. YES