5
$\begingroup$

How can I perform this function with Mathematica?

$$\sum_{1\le j<k\le N}\frac1{\left(r_{jk}\right)^\alpha}$$

where n = 5.

$\endgroup$

1 Answer 1

8
$\begingroup$
n = 5;
Sum[1/r[j, k]^α, {k, 1, n}, {j, 1, k - 1}]

r[1, 2]^-α + r[1, 3]^-α + r[1, 4]^-α + r[1, 5]^-α + r[2, 3]^-α + r[2, 4]^-α +
r[2, 5]^-α + r[3, 4]^-α + r[3, 5]^-α + r[4, 5]^-α

Alternatively,

Sum[Boole[1 <= j < k <= n]/r[j, k]^α, {j, 1, n}, {k, 1, n}]

r[1, 2]^-α + r[1, 3]^-α + r[1, 4]^-α + r[1, 5]^-α + r[2, 3]^-α + r[2, 4]^-α +
r[2, 5]^-α + r[3, 4]^-α + r[3, 5]^-α + r[4, 5]^-α

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.