competitve programming solution here...
An Interesting Sequence Problem Solution Code: CodeChef #include <bits/stdc++.h> using namespace std ; #define endl " \n " int main () { cin. tie ( 0 ); int N = 4 e 6 + 5 ; int phi[N], ans[N]; for ( int i = 0 ; i < N; i ++ ) { phi[i] = i; ans[i] = 0 ; } for ( int p = 2 ; p < N; p ++ ) { if (phi[p] == p) { ...