Number of $2n$-letter words using double $n$-letter alphabet, without consecutive identical letters How many words with $2n$ letters can be created if I have an alphabet with $n$ letters and each of the letters have to occur exactly twice in the word, but no two consecutive letters are equal?
Thanks!

As pointed out in the comments, this sequence appears in the OEIS (A114938), and is a special case of a more general result found elsewhere on this site (e.g., here and here).
The OEIS gives the result as a sum:
$$
A_{n}=\sum_{k=0}^{n}\frac{(-1)^{n-k}(n+k)!}{2^k}{{n}\choose{k}}\\=\frac{1}{2^n}\sum_{k=0}^{n}(-2)^k(2n-k)!{{n}\choose{k}},
$$
where the second version is obtained from the first by changing $k\rightarrow n-k$ in the summation.  To derive this from the more general expression, we write
$$A_{n}=\int_0^\infty (q_2(x))^n \, \exp(-x)\,dx,$$
where $$q_2(x) = \sum_{i=1}^{2} \frac{(-1)^{2-i}}{i!} {2-1 \choose i-1}x^i=\frac{1}{2}x(x-2);$$
so
$$
A_n=\frac{1}{2^n}\int_{0}^{\infty}x^n(x-2)^ne^{-x}dx=\frac{1}{2^n}\sum_{k=0}^{n}(-2)^k{{n}\choose{k}}\int_{0}^{\infty}x^{2n-k}e^{-x}dx,
$$
where the binomial expansion was applied to $(-2+x)^n$.  Since one can readily check that $\int_{0}^{\infty}x^a e^{-x}dx=a!$ (by repeated integration by parts, for instance), the two expressions coincide.
