How to convert the following formula into the traditional form of product?

(x[1] - x[2])^2 (x[1] - x[3])^2 (x[2] - x[3])^2 (x[1] -
x[4])^2 (x[2] - x[4])^2 (x[3] - x[4])^2 (x[1] - x[5])^2 (x[2] -
x[5])^2 (x[3] - x[5])^2 (x[4] - x[5])^2


to

$$\prod_{1 \leqslant j

EDIT

Sorry for my inaccurate description of the problem. This is a problem in the textbook:

$$s_k=x_1^k+x_2^k+\cdots+x_n^k, k=0,1,2, \cdots$$,

$$\boldsymbol{A}=\left(a_{i j}\right)_{n \times m}$$ ， and $$a_{i j}=s_{i+j-2}, i, j=1,2, \cdots, n_{\text {. }}$$

To prove

$$|\boldsymbol{A}|=\prod_{1 \leqslant j

The following is the code taking the 5th order matrix as an example, but I hope to get the results in textbook form ($$\prod_{1 \leqslant j) directly with code.

Clear["Global*"];
s[k_] := Sum[x[v]^k, {v, 1, 5}];
mA[i_, j_] := s[i + j - 2];

mA = Table[mA[i, j], {i, 1, 5}, {j, 1, 5}]
FullSimplify[Det[mA]]


(x[1] - x[2])^2 (x[1] - x[3])^2 (x[2] - x[3])^2 (x[1] - x[4])^2 (x[2] - x[4])^2 (x[3] - x[4])^2 (x[1] - x[5])^2 (x[2] - x[5])^2 (x[3] - x[5])^2 (x[4] - x[5])^2

• What do you mean by convert? Use (x[1] - x[2])^2 (x[1] - x[3])^2 (x[2] - x[3])^2 (x[1] - x[4])^2 (x[2] - x[4])^2 (x[3] - x[4])^2 (x[1] - x[5])^2 (x[2] - x[5])^2 (x[3] - x[5])^2 (x[4] - x[5])^2 as the input and output $\prod_{1 \leqslant j<i \leqslant 5}\left(x_i-x_j\right)^2$, or create an expression that looks like $\prod_{1 \leqslant j<i \leqslant 5}\left(x_i-x_j\right)^2$ and will evaluate to the given expression as shown by Bob in answer below? Commented Sep 20, 2022 at 4:50
• Please take a look at my EDIT. Thank you. @xzczd Commented Sep 20, 2022 at 7:25

\$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global*"];

Format[x[n_]] := Subscript[x, n]

expr = (x[1] - x[2])^2 (x[1] - x[3])^2 (x[2] - x[3])^2*
(x[1] - x[4])^2 (x[2] - x[4])^2 (x[3] - x[4])^2*
(x[1] - x[5])^2 (x[2] - x[5])^2 (x[3] - x[5])^2*
(x[4] - x[5])^2;

(expr2 =
Inactive[Product][(x[i] - x[j])^2, {i, 1, 5}, {j, 1, i - 1}]) //


expr == expr2 // Activate // Simplify

(* True *)


EDIT: More generally,

s[k_, n_] = Sum[x[v]^k, {v, 1, n}];

mA[n_Integer?Positive] :=
Table[s[i + j - 2, n], {i, 1, n}, {j, 1, n}];

(prod[n_] = Inactive[Product][
(x[i] - x[j])^2, {i, 1, n}, {j, 1, i - 1}]) //


And @@ Table[mAdet[n] == prod[n] // Activate // Simplify,
{n, 1, 6}]

(* True *)


EDIT 2: Add zero to the original expression

(expr3 = expr + prod[5] - Activate[prod[5]] // Simplify) //