Check whether 2 ^ p - 1 is prime or not .
let p = 7 ; let checkNumber = Math . pow ( 2 , p ) - 1 ; if ( isPrime ( p ) ) document . write ( checkNumber + " " ) ; else document . write ( checkNumber + " " ) ;