Stirling permutation
In combinatorial mathematics, a Stirling permutation of order k is a permutation of the multiset 1, 1, 2, 2, ..., k, k (with two copies of each value from 1 to k) with the additional property that, for each value i appearing in the permutation, any values between the two copies of i are larger than i. For instance, the 15 Stirling permutations of order three are 1,1,2,2,3,3; 1,2,2,1,3,3; 2,2,1,1,3,3; 1,1,2,3,3,2; 1,2,2,3,3,1; 2,2,1,3,3,1; 1,1,3,3,2,2; 1,2,3,3,2,1; 2,2,3,3,1,1; 1,3,3,1,2,2; 1,3,3,2,2,1; 2,3,3,2,1,1; 3,3,1,1,2,2; 3,3,1,2,2,1; 3,3,2,2,1,1.