I had asked the same question before here Creating a list of functions with desired coefficients but did not get the desired answer, may be I was not clear in my question. I have defined this function to results some list of functions, however its not returning what I want
d = 5;
xs = Array[x,d];
newF[xs_List] := (Sum[((i)*(#[[i]])^2), {i, 2, d}] - Exp[#[[1]]]) & /@ Partition[xs, d, 1, {1, 1}];
newF[xs]
It results in
{-E^x[1] + 2 x[2]^2 + 3 x[3]^2 + 4 x[4]^2 + 5 x[5]^2, -E^x[2] +
5 x[1]^2 + 2 x[3]^2 + 3 x[4]^2 + 4 x[5]^2, -E^x[3] + 4 x[1]^2 +
5 x[2]^2 + 2 x[4]^2 + 3 x[5]^2, -E^x[4] + 3 x[1]^2 + 4 x[2]^2 +
5 x[3]^2 + 2 x[5]^2, -E^x[5] + 2 x[1]^2 + 3 x[2]^2 + 4 x[3]^2 +
5 x[4]^2}
What I want this to return
{-E^x[1] + 2 x[2]^2 + 3 x[3]^2 + 4 x[4]^2 + 5 x[5]^2, -E^x[2] +
x[1]^2 + 3 x[3]^2 + 4 x[4]^2 + 5 x[5]^2, -E^x[3] + x[1]^2 +
2 x[2]^2 + 4 x[4]^2 + 5 x[5]^2, -E^x[4] + x[1]^2 + 2 x[2]^2 +
3 x[3]^2 + 5 x[5]^2, -E^x[5] + x[1]^2 + 2 x[2]^2 + 3 x[3]^2 +
4 x[4]^2}
Basically I want is $-e^{x_k}+\sum_{n\neq k}n\cdot x_n^2$
The input should be that array $xs.$ I want it for different values of 'd'.
Further I should be able to evaluate it at an array like $(1,1,1,1,1)$ or $(1,2,3,4,5).$ I mean is I can define
ys = ConstantArray[1/10, d];
and evaluate
newF[ys]