Check whether 2 ^ q - 1 is a prime number or not
if ( isPrime ( ( long ) Math . Pow ( 2 , pow + 1 ) - 1 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } else Console . ( " No " ) ; } else Console . ( " No " ) ; }