Check if permutation of first N natural numbers exists having Bitwise AND of adjacent elements non | Function to check if a permutation of first N natural numbers exist with Bitwise AND of adjacent elements not equal to 0 ; If n is a power of 2 ; Driver Code
function check ( n ) { if ( ( n & n - 1 ) != 0 ) document . write ( " " ) ; else document . write ( " " ) ; } var n = 5 ; check ( n ) ;