Literal methods
First way I thought of:
f1 = Table[Total[1/Abs[#[[i]] - Delete[#, i]]^2], {i, Length@#}] &;
f1[{a, b, c}]
{1/Abs[a - b]^2 + 1/Abs[a - c]^2,
1/Abs[-a + b]^2 + 1/Abs[b - c]^2,
1/Abs[-a + c]^2 + 1/Abs[-b + c]^2}
Or using MapIndexed as rasher did, but using the listability of all operations:
f2[old_List] := MapIndexed[Total[1/(Abs[# - Drop[old, #2]]^2)] &, old]
f2[{a, b, c}]
{1/Abs[a - b]^2 + 1/Abs[a - c]^2,
1/Abs[-a + b]^2 + 1/Abs[b - c]^2,
1/Abs[-a + c]^2 + 1/Abs[-b + c]^2}
See Case #4 in Alternatives to procedural loops and iterating over lists in Mathematica.
Note: you can use Tr in place of Total for vector sums; it is slightly faster on packed arrays, and syntactically shorter which I like. However it gives the trace of a matrix (of course) rather than a sum, so I did not use it here just in case your list elements are themselves lists.
Matrix method
Unlike the methods above that Delete or Drop the unwanted element, we can leave this element, replace the resulting zeros with ones, perform the sum, and then remove the ones again.
f3[old_List] :=
With[{diag = IdentityMatrix @ Length @ old},
Total[1/(Abs[# - old & /@ old]^2 + diag), {2}] - 1
]
f3[{a, b, c}]
{1/Abs[a - b]^2 + 1/Abs[a - c]^2,
1/Abs[-a + b]^2 + 1/Abs[b - c]^2,
1/Abs[-a + c]^2 + 1/Abs[-b + c]^2}
Extensions
You asked about a variation of this operation. Here are examples.
g1[old_List] := MapIndexed[# - Drop[old, #2] &, old] // Total[#/Abs[#]^2, {2}] &
g1[{a, b, c}]
{(a - b)/Abs[a - b]^2 + (a - c)/Abs[a - c]^2,
(-a + b)/Abs[-a + b]^2 + (b - c)/Abs[b - c]^2,
(-a + c)/Abs[-a + c]^2 + (-b + c)/Abs[-b + c]^2}
g2[old_List] :=
With[{
diag = IdentityMatrix @ Length @ old,
sub = # - old & /@ old
},
Total[sub/(Abs[sub]^2 + diag), {2}]
]
g2[{a, b, c}] === g1[{a, b, c}]
True
Timings
Here are timings of each of these methods performed in Mathematica 7. I had hoped that the matrix method (f3) would be faster, but at least in the extended example it is faster than the alternative. (This test uses over 1GB of RAM.)
SetAttributes[timeAvg, HoldFirst]
timeAvg[func_] := Do[If[# > 0.3, Return[#/5^i]] & @@ Timing@Do[func, {5^i}], {i, 0, 15}]
big = RandomReal[{-9, 9}, 5000];
timeAvg[#@big] & /@ {f1, f2, f3}
{0.405, 0.39, 0.437}
timeAvg[#@big] & /@ {g1, g2}
{1.201, 0.484}