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{3, 4, 1, 5, 2}, {3, 4, 2, 1, 5}, {3, 4, 2, 5, 1},
{3, 4, 5, 1, 2}, {3, 4, 5, 2, 1}, {3, 5, 1, 2, 4}, {3, 5, 1, 4, 2}, {3, 5, 2, 1, 4}, {3, 5, 2, 4, 1},
{3, 5, 4, 1, 2}, {3, 5, 4, 2, 1}, {4, 1, 2, 3, 5}, {4, 1, 2, 5, 3}, {4, 1, 3, 2, 5}, {4, 1, 3, 5, 2},
{4, 1, 5, 2, 3}, {4, 1, 5, 3, 2}, {4, 2, 1, 3, 5}, {4, 2, 1, 5, 3}, {4, 2, 3, 1, 5}, {4, 2, 3, 5, 1},
{4, 2, 5, 1, 3}, {4, 2, 5, 3, 1}, {4, 3, 1, 2, 5}, {4, 3, 1, 5, 2}, {4, 3, 2, 1, 5}, {4, 3, 2, 5, 1},
{4, 3, 5, 1, 2}, {4, 3, 5, 2, 1}, {4, 5, 1, 2, 3}, {4, 5, 1, 3, 2}, {4, 5, 2, 1, 3}, {4, 5, 2, 3, 1},
{4, 5, 3, 1, 2}, {4, 5, 3, 2, 1}, {5, 1, 2, 4, 3}, {5, 1, 3, 2, 4}, {5, 1, 3, 4, 2}, {5, 1, 4, 2, 3},
{5, 1, 4, 3, 2}, {5, 2, 1, 3, 4}, {5, 2, 1, 4, 3}, {5, 2, 3, 1, 4}, {5, 2, 3, 4, 1}, {5, 2, 4, 1, 3},
{5, 2, 4, 3, 1}, {5, 3, 1, 2, 4}, {5, 3, 1, 4, 2}, {5, 3, 2, 1, 4}, {5, 3, 2, 4, 1}, {5, 3, 4, 1, 2},
{5, 3, 4, 2, 1}, {5, 4, 1, 2, 3}, {5, 4, 1, 3, 2}, {5, 4, 2, 1, 3}, {5, 4, 2, 3, 1}, {5, 4, 3, 1, 2},
{5, 4, 3, 2, 1}}
In[3]:= Length[DeleteCases[Permutations[{1, 2, 3, 4, 5}], {___, 1, ___, 2, ___, 3, ___, 4, ___}]]
Out[3]= 115
In[4]:= Length[DeleteCases[Permutations[{1, 2, 3, 4, 5}], {___, 1, ___, 2, ___, 3, ___, 4, ___} |
{___, 1, ___, 3, ___, 4, ___, 2, ___} | {___, 1, ___, 3, ___, 2, ___, 4, ___}]]
Out[4]= 105
In[5]:= Length[DeleteCases[Permutations[{1, 2, 3, 4, 5, 6}], {___, 1, ___, 2, ___, 3, ___, 4, ___} |
{___, 1, ___, 3, ___, 4, ___, 2, ___} | {___, 1, ___, 3, ___, 2, ___, 4, ___}]]
Out[5]= 630
I must be making some mistake because my counts don't seem to match yours. If you can track down one or more of the
permutations that are incorrectly being counted in this code then I will find a way to correct the code and automate your count.