Description
"Imtiaz Germain primes" is not a technical name in Mathematics, but my weird creation, in the memoir of the famous mathematician Sophie Germain. These primes can be generated by the following process:
1. Take a Safe prime
2. Apply 2p + 1 on it to obtain a composite number
3. Apply 2p + 1 once more to obtain a prime number
The idea can be further illustrated in the example.
Example
We check if 3
is a Sophie Germain prime. It has a safe prime 7
using 2p+1
so 3
is a Sophie Germain prime and can/cannot be an Imtiaz Germain prime. We take the safe prime, apply 2p+1
on it, and get 15
which must be composite according to the second step of the description, applying the same, we must get a prime next, which is 31
so 3
is an Imtiaz Germain prime. All Imtiaz Germain primes below 100M are available in Chapter 1 of the book I wrote here.
Task
Write a program, which inputs any number, and mentions all Imtiaz Germain primes below the number. As long as fulfills the full output, you may output the Imtiaz Germain primes in reversed order. Since it is code golf, the shortest code in bytes win, if bytes are equated then the earliest posted program wins.
Test Cases
10 => 3
1500 => 3 23 29 53 113 233 293 419 593 653 659 683 1013 1103 1223 1439
10000 => 3 23 29 53 113 233 293 419 593 653 659 683 1013 1103 1223 1439 1559 1583 1973 2039 2273 2339 2549 2753 3299 3359 3593 3803 3863 4019 4409 4733 4793 4919 4943 5003 5279 5639 6173 6263 6269 6323 6563 6983 7433 7643 7823 8243 8273 8513
Thanks to Aira for writing this task for me, I am clearly unaware of how to write still. The following task is written to celebrate my first time beating 1k on a SE Network, and to fighting autism. And to someone... who is my entire life, to Sophie Germain, people say I am suffering hallucinations to see her, it is my love for her that I hallucinate her