# Thread: Number of permutations

1. ## Number of permutations

In how many ways can the elements of [n] be permuted so that the sum of every two consecutive elements in the permutation is odd?

[n] is the set of integers from 1 to n.

My attempt:

If n is even:
$n\frac{n}{2}\left(\frac{n}{2} - 1\right)\left(\frac{n}{2}-1\right)\left(\frac{n}{2}-2\right)\left(\frac{n}{2}-2\right)...=2\left(\frac{n}{2}!\right)^2$

If n is odd, we must start with an odd element:
$\left(\frac{n+1}{2}\right)\left(\frac{n-1}{2}\right)\left(\frac{n-1}{2}\right)\left(\frac{n-3}{2}\right)\left(\frac{n-3}{2}\right)...$ $=\left(\frac{n+1}{2}\right)\left(\frac{n-1}{2}!\right)^2$

Is this right?

2. ## Re: Number of permutations

Originally Posted by alexmahone
In how many ways can the elements of [n] be permuted so that the sum of every two consecutive elements in the permutation is odd?
[n] is the set of integers from 1 to n.

My attempt:
If n is even:
$n\frac{n}{2}\left(\frac{n}{2} - 1\right)\left(\frac{n}{2}-1\right)\left(\frac{n}{2}-2\right)\left(\frac{n}{2}-2\right)...=2\left(\frac{n}{2}!\right)^2$

If n is odd, we must start with an odd element:
I agree with you as far as that goes.
But in is odd it should be: because start with an odd and alternate
$\left[ {\left( {\frac{{n + 1}}{2}} \right)!} \right] \cdot \left[ {\left( {\frac{{n - 1}}{2}} \right)!} \right]$

3. ## Re: Number of permutations

Originally Posted by Plato
I agree with you as far as that goes.
But in is odd it should be: because start with an odd and alternate
$\left[ {\left( {\frac{{n + 1}}{2}} \right)!} \right] \cdot \left[ {\left( {\frac{{n - 1}}{2}} \right)!} \right]$
Actually, that's exactly what I got. But there was a problem with the latex (which I've now fixed).

$\left(\frac{n+1}{2}\right)\left(\frac{n-1}{2}!\right)^2 = \left(\frac{n+1}{2}!\right)\left(\frac{n-1}{2}!\right)$