Let's work a few examples with a growing value of #n# and see if we can find a pattern. Let's assign A and Z to the two people who must be separated.
When #n=3#, there are 2 ways we can sit the people - AXZ and ZXA. Ordinarily, we'd be able to sit 3 people in #3! = 6# ways.
When #n=4#, we can sit A and Z in seats 1, 3; 1, 4; and 2, 4 - which is 6 different ways. The other two people can sit in 2! = 2 ways for each of the 6 ways we can seat A and Z, which is #6xx2=12# ways. Ordinarily, we could seat four people #4! = 24# ways.
When #n=5#, we can seat A and Z in seats 1, 3; 1, 4; 1, 5; 2, 4; 2, 5; 3, 5 - which is 12 different ways. The remaining three people can sit in #3! = 6# different ways, giving #12xx6=72# ways. Ordinarily, we'd seat 5 people in #5! = 120# ways.
When #n=6#, we can seat A and Z in seats 1, 3; 1, 4; 1, 5; 1, 6; 2, 4; 2, 5; 2, 6; 3, 5; 3, 6; 4, 6 - which is 20 ways. The remaining four people can sit in #4! = 24# different ways, giving #20xx24 = 480# ways. Ordinarily, we'd seat 6 people in #6! = 720# ways.
What can we find from the above?
When:
- #n=3, x=1#
- # n=4, x=3#
- # n=5, x=6#
- # n=6, x=10#.
And so we can express #x# as the sum of the natural numbers from 1 to #(n-2)#:
#x=sum_(y=1)^(n-2)y#
And that is the expression we can use to answer our question:
#"Ways" = 2x((n-2)!), "where " x=sum_(y=1)^(n-2)y#
Let's give this a quick test. For #n=6#, we have:
#2x((6-2)!), x=sum_(y=1)^(n-2)y=1+2+3+4=10#
#2(10)(4!)=20xx24=480#
For fun, let's try #n=10#:
#2x((10-2)!), x=sum_(y=1)^(n-2)y=1+2+3+4+5+6+7+8=36#
#2(36)(8!)=72xx40320=2,903,040#