Pair of integers having difference of their fifth power as X | Function to find a pair of integers A & B such that difference of fifth power is equal to the given number X ; Loop to choose every possible pair with in the range ; Check if equation holds ; Driver Code ; Function Call
function findPair ( x ) { let lim = 120 ; for ( let i = - lim ; i <= lim ; i ++ ) for ( let j = - lim ; j <= lim ; j ++ ) if ( Math . pow ( i , 5 ) - Math . pow ( j , 5 ) == x ) { document . write ( i + " " + j ) ; return ; } document . write ( " " ) ; } let X = 33 ; findPair ( X ) ;