Since the program starts counting from 0 by default, I made a function to display from 1 which is usually used.
from sympy.combinatorics import *
from sympy import *
init_printing(pretty_print=False)
SymmetricGroup(3)[1]
#Permutation(2)(0, 1)
n = 3
def plusone(x):
X = tuple([0])
for i in range(n):
a = tuple([tuple(x)[i] + 1])
X = X + a
return Permutation(tuple(X))
plusone(SymmetricGroup(3)[1])
#Permutation(3)(1, 2)
The goal is a product table of fifth-order symmetric groups.
Next article: Python de Symmetric Group 2-Qiita