Find nth term of a given recurrence relation | function to return required value ; Get the answer ; Return the answer ; Get the value of n ; function call to prresult
def sum ( n ) : NEW_LINE INDENT ans = ( n * ( n - 1 ) ) / 2 ; NEW_LINE return ans NEW_LINE DEDENT n = 5 NEW_LINE print ( int ( sum ( n ) ) ) NEW_LINE