Special Primes
CodeChefOpen on judge ↗
Prime numbers are arranged in a ordered list $U$, in increasing order. Let $S$ be a sublist of $U$ with a unique property that for every element $A$ belonging to list $S$, if $i$ denotes the index of $A$ in list $U$, than $i$ also belongs to list $U$. Given $N$, find sum of first $N$ elements of list $S$, assuming 1-based indexing. As the sum can be very large, print the sum modulo $10^{9}+7$.
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start