Group all co | Function to group the mutually co - prime numbers into one group ; Loop for the numbers less than the 4 ; Integers 1 , 2 and 3 can be grouped into one group ; Consecutive even and odd numbers ; Driver Code ; Function Call
def mutually_coprime ( n ) : NEW_LINE INDENT if ( n <= 3 ) : NEW_LINE INDENT for j in range ( 1 , n + 1 ) : NEW_LINE INDENT print ( j , end = " ▁ " ) NEW_LINE DEDENT print ( ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( 1 , 2 , 3 ) NEW_LINE for j in range ( 4 , n , 2 ) : NEW_LINE INDENT print ( j , ( j + 1 ) ) NEW_LINE DEDENT if ( n % 2 == 0 ) : NEW_LINE INDENT print ( n ) NEW_LINE DEDENT DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n = 9 NEW_LINE mutually_coprime ( n ) NEW_LINE DEDENT