LongestCoxeterWord( W )
returns a reduced expression in the standard generators for the unique element of maximal length of the Coxeter group W.
gap> LongestCoxeterWord( CoxeterGroup( "A", 4 ) ); [ 1, 2, 1, 3, 2, 1, 4, 3, 2, 1 ]
This function requires the package "chevie" (see RequirePackage).
GAP 3.4.4