Check whether a number can be represented as difference of two squares | Function to check whether a number can be represented by the difference of two squares ; Checking if n % 4 = 2 or not ; Driver code
def difSquare ( n ) : NEW_LINE INDENT if ( n % 4 != 2 ) : NEW_LINE INDENT return True NEW_LINE DEDENT return False NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT n = 45 NEW_LINE if ( difSquare ( n ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT