(Subscript[a, 3])

(((x+y))^5)

K=X[1,5,2,4]X[3,1,4,6]X[5,3,6,2]

K

(x+y)^5 /. 5->6

z=Expand[(x+y)^5] (* Gonzalo says its the binoimial formula *)

z /. 5->6

"Trist5" /. 5->6

5Trist /. 5->7

5Trist /. Trist -> Etienne

StringReplace["Trist5", "5"->"7"]

z

z /. _ ->t

z /. _Symbol -> t

z /. x|y -> t

l={1,2,3}

l /. n_Integer -> n^2

l /. K_Integer -> K^2

l /. K_Integer :>  K^2

K_Integer -> K^2

K_Integer :> K^2

t1= K /. X[i_Integer, j_Integer, k_Integer, l_Integer] :> A P[i,j]P[k,l]+B P[j,k]P[i,l]

{Etienne1, Etienne 1}

t1= K /. X[i_, j_, k_, l_] :> A P[i,j]P[k,l]+B P[j,k]P[i,l]

t2=Expand[t1]

t3=t2 /. P[i_,j_]P[j_,k_] :> P[i,k]

t3=t2 //. P[i_,j_]P[j_,k_] :> P[i,k]

t4=t3 /. {P[i_,j_]^2 ->d, P[i_,i_] -> d}

t5=Simplify[t4 /. {B->1/A, d->-A^2-1/A^2}]

K17=X[1,12,2,13]X[3,8,4,9]X[5,1,6,16]X[7,2,8,3]X[9,15,10,14]X[11,4,12,5]X[13,7,14,6]X[15,11,16,10]

t1= K17 /. X[i_, j_, k_, l_] :> A P[i,j]P[k,l]+B P[j,k]P[i,l]

t2=Expand[t1]

Plus[5,6]

Attributes[Plus]

{P[1,2], P[2,1]}

SetAttributes[P, Orderless]

{P[1,2], P[2,1]}

SetAttributes[P, Orderless];
t3=t2 //. P[i_,j_]P[j_,k_] :> P[i,k];

Short[t3]

t4=t3 /. {P[i_,j_]^2 ->d, P[i_,i_] -> d}

t5=Simplify[t4 /. {B->1/A, d->-A^2-1/A^2}]

n=3; a=n; a

n=3; a=n;n=5; a

Clear[a,n]

{a,n}

n=3; a:=n;n=5; a

KB[K_] := (
t1= K /. X[i_, j_, k_, l_] :> A P[i,j]P[k,l]+B P[j,k]P[i,l];
t2=Expand[t1];
SetAttributes[P, Orderless];
t3=t2 //. P[i_,j_]P[j_,k_] :> P[i,k];
t4=t3 /. {P[i_,j_]^2 ->d, P[i_,i_] -> d};
Simplify[t4 /. {B->1/A, d->-A^2-1/A^2}]
)

KB[K17]

K

KB[K]

t2

KB[K17]

Length[t2]

lhs=KB[X[8,4,5,9]X[6,1,ar,9]X[ar,2,3,8]]

t1

t2

t3

t4

rhs=KB[X[2,7,ar,1]X[6,ar,12,5]X[12,7,3,4]]

lhs

lhs==rhs

ew65