We have made array till 2 * n + 1 so that we can check prime number till that and conclude about sophie german prime .
bool prime [ 2 * n + 1 ] ; memset ( prime , true , sizeof ( prime ) ) ; sieve ( 2 * n + 1 , prime ) ; for ( int i = 2 ; i <= n ; ++ i ) {