Function to check if N satisfies the equation 2 * reverse ( n ) = n + 1
def check ( n ) : NEW_LINE INDENT x = ( n + 7 ) // 8 NEW_LINE if ( ( n + 7 ) % 8 == 0 and isPower ( 10 , x ) ) : NEW_LINE INDENT return True NEW_LINE DEDENT else : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT