Check whether 2 ^ p - 1 is prime or not .
int p = 7 ; double checkNumber = Math . Pow ( 2 , p ) - 1 ; if ( isPrime ( p ) ) Console . WriteLine ( ( int ) checkNumber + " ▁ is ▁ Prime . " ) ; else Console . WriteLine ( ( int ) checkNumber + " ▁ is ▁ not ▁ Prime . " ) ; } }