human
Find trace of matrix formed by adding Row | Return sum of first n integers of an AP.
Return the trace of sum of row - major matrix and column - major matrix.
Finding nth element in AP in case of Row major matrix ..
Finding sum of first n integers of AP in case of Row major matrix.
Finding nth element in AP in case of Row major matrix.
Finding sum of first n integers of AP in case of Column major matrix.
Driver Code"
Solution in Python:

=====
What is a code to find trace of matrix formed by adding Row and the other steps required?
assistant
#Here is code to find trace of matrix formed by adding Row and the other steps required.
 def sn ( n , an ) :
	return ( n * ( 1 + an ) ) / 2 ;
def trace ( n , m ) :
	an = 1 + ( n - 1 ) * ( m + 1 ) ;
	rowmajorSum = sn ( n , an ) ;
	an = 1 + ( n - 1 ) * ( n + 1 ) ;
	colmajorSum = sn ( n , an ) ;
	return int ( rowmajorSum + colmajorSum ) ;
N = 3 ;
M = 3 ;
print ( trace ( N , M ) ) ;