if the remainder after subtracting previous power of 2 is also a power of 2 then it can be expressed as 2 ^ x + 2 ^ y
$ x = previousPowerOfTwo ( $ n ) ; $ y = $ n - $ x ; if ( isPowerOfTwo ( $ y ) ) { echo $ x , " " , $ y ; return true ; } } return false ; }