#NEWLINE# def fun( self , x , * args ) : #NEWLINE# #INDENT# self . nfev += 1 #NEWLINE# i = arange ( 2 , ( self . N + 1 ) ) #NEWLINE# s = ( i * ( ( ( 2.0 * ( i [ 1 : ] ** 2.0 ) ) - x [ : ( - 1 ) ] ) ** 2.0 ) ) #NEWLINE# return ( sum ( s ) + ( ( x [ 0 ] - 1.0 ) ** 2.0 ) )