In number theory, a semiprime is a natural number that is the product of exactly two prime numbers. The two primes in the product may equal each other, so the semiprimes include the squares of prime numbers.
Because there are infinitely many prime numbers, there are also infinitely many semiprime numbers. Semiprimes are also called biprimes, since they include two primes, or second numbers, by analogy with how "prime" means "first". Alternatively, semiprimes are called almost-prime numbers, specifically the "2-almost-prime" biprime and "3-almost-prime" triprime.
Examples and variations
The semiprimes less than 100 are:
Semiprimes that are not square numbers are called <i>discrete</i>, <i>distinct</i>, or <i>squarefree</i> semiprimes:
The semiprimes are the case <math>k=2</math> of the <math>k</math>-almost primes, numbers with exactly <math>k</math> prime factors. However some sources use "semiprime" to refer to a larger set of numbers, the numbers with at most two prime factors (including unit (1), primes, and semiprimes). These are:
Formula for number of semiprimes
A semiprime counting formula was discovered by E. Noel and G. Panos in 2005. Let <math>\pi_2(n)</math> denote the number of semiprimes less than or equal to n. Then
<math display=block>\pi_2(n) = \sum_{k=1}^{\pi \left(\sqrt n\right) } \left[\pi\left(\frac{n}{p_k}\right) - k + 1 \right]</math>
where <math>\pi(x)</math> is the prime-counting function and <math>p_k</math> denotes the kth prime.
Properties
Semiprime numbers have no composite numbers as factors other than themselves. For example, the number 26 is semiprime and its only factors are 1, 2, 13, and 26, of which only 26 is composite.
For a squarefree semiprime <math>n=pq</math> (with <math>p\ne q</math>)
the value of Euler's totient function <math>\varphi(n)</math> (the number of positive integers less than or equal to <math>n</math> that are relatively prime to <math>n</math>) takes the simple form
<math display=block>\varphi(n)=(p-1)(q-1)=n-(p+q)+1.</math>
This calculation is an important part of the application of semiprimes in the RSA cryptosystem.
For a square semiprime <math>n=p^2</math>, the formula is again simple:
In 1974 the Arecibo message was sent with a radio signal aimed at a star cluster. It consisted of <math>1679</math> binary digits intended to be interpreted as a <math>23 \times 73</math> bitmap image. The number <math>1679=23\cdot 73</math> was chosen because it is a semiprime and therefore can be arranged into a rectangular image in only two distinct ways (23 rows and 73 columns, or 73 rows and 23 columns).
See also
- Chen's theorem
- Sphenic number, a product of three distinct primes
- Parity problem (sieve theory)
