Check if a number can be represented as sum of non zero powers of 2 | Function that return true if n can be represented as the sum of powers of 2 without using 2 ^ 0 ; Driver code
< ? php function isSumOfPowersOfTwo ( $ n ) { if ( $ n % 2 == 1 ) return false ; else return true ; } $ n = 10 ; if ( isSumOfPowersOfTwo ( $ n ) ) echo ( " Yes " ) ; else echo ( " No " ) ; ? >