This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A180605 #32 Sep 04 2019 09:29:16 %S A180605 1,2,14,330,25396,6272842,4925166862,12221171869734,95482373388042562 %N A180605 Number of commutation classes of reduced words for the longest element of a Weyl group of type B_n. %H A180605 <a href="/A180605/b180605.txt">Table of n, a(n) for n = 1..9</a> %H A180605 Matthew J. Samuel, <a href="http://arxiv.org/abs/1101.4655">Word posets, complexity, and Coxeter groups</a>, arXiv:1101.4655 [math.CO] %e A180605 For n=2 the a(2)=2 commutation classes of words are 0101 and 1010. %e A180605 For n=3 the a(3)=14 commutation classes of words are those of 210121010, 121012010, 212012010, 120101210, 101210120, 120120120, 210120101, 201012101, 012101201, 201201201, 012010121, 101201012, 010121012, 012012012. %p A180605 #classes: Wrapper for computing number of commutation classes; pass a permutation of type B as a list %p A180605 #Returns number of commutation classes %p A180605 #Longest element is of the form [-1, -2, ..., -n] %p A180605 classes:=proc(perm) option remember: %p A180605 RETURN(classesRecurse(Array(perm),-1,1)): %p A180605 end: %p A180605 #classesRecurse: Recursive procedure for computing number of commutation classes %p A180605 classesRecurse:=proc(perm, spot, negs) local swaps, i, sums, c, doneany: %p A180605 sums:=0: %p A180605 doneany:=0: %p A180605 for i from spot to ArrayNumElems(perm)-2 do %p A180605 if i=-1 and perm[1]<0 then %p A180605 perm[1]:=-perm[1]: %p A180605 c:=classes(convert(perm,`list`)): %p A180605 sums:=sums+negs*c+classesRecurse(perm,i+2,-negs): %p A180605 perm[1]:=-perm[1]: %p A180605 doneany:=1: %p A180605 elif i>-1 and perm[i+1]>perm[i+2] then %p A180605 swaps:=perm[i+1]: %p A180605 perm[i+1]:=perm[i+2]: %p A180605 perm[i+2]:=swaps: %p A180605 c:=classes(convert(perm, `list`)): %p A180605 sums:=sums+negs*c+classesRecurse(perm,i+2,-negs): %p A180605 swaps:=perm[i+1]: %p A180605 perm[i+1]:=perm[i+2]: %p A180605 perm[i+2]:=swaps: %p A180605 doneany:=1: %p A180605 end: %p A180605 end: %p A180605 if spot=-1 and doneany=0 then RETURN(1): %p A180605 else RETURN(sums): %p A180605 end: %p A180605 end: %K A180605 nonn,hard,more %O A180605 1,2 %A A180605 _Matthew J. Samuel_, Jan 21 2011 %E A180605 a(9) computed with a Java program by _Matthew J. Samuel_, Jan 30 2011