Check if a number can be represented as sum of two consecutive perfect cubes | Function to check that a number is the sum of cubes of 2 consecutive numbers or not ; Condition to check if a number is the sum of cubes of 2 consecutive numbers or not ; Driver Code ; Function call
def isSumCube ( N ) : NEW_LINE INDENT a = int ( pow ( N , 1 / 3 ) ) NEW_LINE b = a - 1 NEW_LINE ans = ( ( a * a * a + b * b * b ) == N ) NEW_LINE return ans NEW_LINE DEDENT i = 35 NEW_LINE if ( isSumCube ( i ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT