Check if the concatenation of first N natural numbers is divisible by 3 | Function that returns True if concatenation of first N natural numbers is divisible by 3 ; Check using the formula ; Driver Code ; Given Number ; Function Call
def isDivisible ( N ) : NEW_LINE INDENT return ( N - 1 ) % 3 != 0 NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = 6 NEW_LINE if ( isDivisible ( N ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT