Input a number to check if it is a Chen prime, or input a start and end range to generate all Chen primes within that range.
A Chen prime is a prime number \(p\) that satisfies the following condition: \(p+2\) is either a prime number or a semiprime (the product of exactly two primes).
Using this definition, you can determine if a number is a Chen prime or generate a list of Chen primes.
To check if a given number \(p\) is a Chen prime, follow these steps:
Solution:
1. Is 101 a prime number?
Yes, 101 is a prime number.
2. Calculate \(101 + 2 = 103\).
103 is also a prime number.
Result: 101 is a Chen prime.
Solution:
1. Is 199 a prime number?
Yes, 199 is a prime number.
2. Calculate \(199 + 2 = 201\).
201 is not a prime number; it is a semiprime (\(201 = 3 \times 67\)).
Result: 199 is a Chen prime.
Solution:
1. Is 397 a prime number?
Yes, 397 is a prime number.
2. Calculate \(397 + 2 = 399\).
399 is neither a prime number nor a semiprime (\(399 = 3 \times 7 \times 19\)).
Result: 397 is not a Chen prime.