List the primes in order, 2, 3, 5, 7, 11, 13, 17, …, and number their positions from 1. A super prime is a prime that sits at a prime position: positions 2, 3, 5, 7, … give 3, 5, 11, 17, ….
The plan is a two-level sieve:
- sieve all primes up to
n - walk that list with a 1-based index and keep entries whose index is prime. One sieve covers both, since every index is ≤ n.
Combining a precomputed table with a second filter is how many "number of the number" puzzles are solved.