function return p - 1 ( = x argument ) as x * 2 ^ e , where x will be odd sending e as reference because updation is needed in actual e
function convertx2e ( $ x , & $ e ) { $ e = 0 ; while ( $ x % 2 == 0 ) { $ x = ( int ) ( $ x / 2 ) ; $ e ++ ; } return $ x ; }