Check whether 2 ^ p - 1 is prime or not .
int p = 7 ; long long checkNumber = pow ( 2 , p ) - 1 ; if ( isPrime ( p ) ) cout << checkNumber << " ▁ is ▁ Prime . " ; else cout << checkNumber << " ▁ is ▁ not ▁ Prime . " ; return 0 ; }