human
Rearrange array to maximize sum of GCD of array elements with their respective indices | Function to find the maximum sum of GCD ( arr [ i ] , i ) by rearranging the array.
Stores maximum sum of GCD ( arr [ i ] , i ) by rearranging the array elements.
Update res.
Driver Code"
Solution in Python:

Give me a code to rearrange array to maximize sum of GCD of array elements with their respective indices and the other steps required?
assistant
#Here is code to rearrange array to maximize sum of GCD of array elements with their respective indices and the other steps required.
 def findMaxValByRearrArr ( arr , N ) :
	res = 0 ;
	res = ( N * ( N + 1 ) ) // 2 ;
	return res ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 3 , 2 , 1 ] ;
	N = len ( arr ) ;
	print ( findMaxValByRearrArr ( arr , N ) ) ;