Find the permutation of first N natural numbers such that sum of i % Pi is maximum possible | Function to find the permutation of the first N natural numbers such that the sum of ( i % Pi ) is maximum possible and return the maximum sum ; Driver code ; Function call
def Max_Sum ( n ) : NEW_LINE INDENT return ( n * ( n - 1 ) ) // 2 ; NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n = 8 ; NEW_LINE print ( Max_Sum ( n ) ) ; NEW_LINE DEDENT