A number is a Chen prime if it satisfies two conditions:
- It is prime itself
- Itself plus two is either a prime or a semi-prime.
A prime is a number where it has exactly two divisors and those divisors consist of itself and one.
A semi-prime is a number which is the product of two primes. (Note that 12 = 2*2*3 is not semi-prime, but 25 = 5*5 is).
Your task is to determine if a number is a Chen prime. You should output any truthy value for yes and any falsy value for no.
The input will be any integer greater than or equal to one. It may also be taken as a string, character array, or an array or digits.
101 -> truthy 223 -> falsy 233 -> truthy 1 -> falsy
This is OEIS A109611.
This is, in part, inspired by Am I a Sophie Germain prime? which, unfortunately, got closed as a duplicate, so I'm posting a somewhat related challenge which isn't a duplicate.