Input a number to check if it's a semiprime, or specify a range to generate all semiprime numbers within that range.
Semiprime Check or Generate
Result
Result
What Is a Semiprime?
A semiprime is a positive integer that is the product of exactly two prime numbers, which may be the same. For example, 4 (2×2), 6 (2×3), 9 (3×3), and 15 (3×5) are all semiprime numbers.
How to Determine If a Number Is a Semiprime
For the given number \( n \), start testing divisors \( p \) from 2 onward.
If \( p \) is a factor of \( n \), compute \( q = n / p \).
Check if both \( p \) and \( q \) are prime.
If such a pair \( (p, q) \) is found, \( n \) is a semiprime. Otherwise, it is not.
Examples
Example 1: Is 15 a Semiprime?
Solution:
Factors of 15:
\( 15 = 3 \times 5 \), where both 3 and 5 are prime numbers.
Result: 15 is a semiprime.
Example 2: Is 28 a Semiprime?
Solution:
Factors of 28:
\( 28 = 2 \times 14 \), but 14 is not a prime number.
\( 28 = 4 \times 7 \), but 4 is not a prime number.
\( 28 = 7 \times 4 \), but 4 is not a prime number.
\( 28 = 14 \times 2 \), but 14 is not a prime number.
Result: 28 is not a semiprime.
Example 3: Is 2021 a Semiprime?
Solution:
Factors of 2021: 1, 43, 47, 2021
\( 2021 = 43 \times 47 \), where both 43 and 47 are prime numbers.