Pair of integers having difference of their fifth power as X | Python3 implementation to find a pair of integers A & B such that difference of fifth power is equal to the given number 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
import math NEW_LINE def findPair ( x ) : NEW_LINE INDENT lim = 120 NEW_LINE for i in range ( - lim , lim + 1 ) : NEW_LINE INDENT for j in range ( - lim , lim + 1 ) : NEW_LINE INDENT if ( math . pow ( i , 5 ) - math . pow ( j , 5 ) == x ) : NEW_LINE INDENT print ( i , end = ' ▁ ' ) NEW_LINE print ( j , end =   ' ' ) NEW_LINE return NEW_LINE DEDENT DEDENT DEDENT print ( " - 1" ) NEW_LINE DEDENT X = 33 NEW_LINE findPair ( X ) NEW_LINE