2698725

seq length 10, 5 double digits

let A be strings that end in a, B that end in b, until E= strings that end in e. The Ordinary Generating Function system is then $$ \begin{cases} A = a + a.(B+C+D+E), \\ B = b + b.(A+C+D+E),\\ C = c + c.(A+B+D+E),\\ D = d + d.(A+B+C+E),\\ E = e + e.(A+B+C+D),\\ S = A+B+C+D+E \end{cases} $$

Maple solve delivers as generating function :

$$ \frac { a+ b + c+ d + e  + 2( ab + ac + ...)  + 3(abc + abd + ... ) + 4(abcd + abce ... )  + 5abcde}{    1 -(ab + ac ...) - 2(abc + abd + ... ) - 3(abcd + abce ... ) - 4abcde }$$

The required number is the coefficient of $$ a^2b^2c^2d^2e^2 $$ and it is $$39480$$

=
=============================

let T(2n) be the total number of sequences of n digits.

$$T(2n) = \binom {2n}{2}\binom {2n-2}{2} ...\binom {4}{2} \binom {2}{2}$$

Let $$T_1, T_2, T_3, T4, T_5$$ be the number of sequences that have at least a bad couple, at least two bad couples, etc.

$$n_1 = \binom {5}{1}.\ 1!\ .\binom {8+1}{1}    \times T(8) $$

$$n_2 = \binom {5}{2}.\ 2!\ .\binom {6+2}{2}   \times T(6) $$

$$n_3 = \binom {5}{3}.\ 3!\ .\binom {4+3}{3} \times T(4) $$

$$n_4 = \binom {5}{4}.\ 4!\ .\binom {2+4}{4} \times T(2) $$

$$n_5 = \binom {5}{5}.\ 5!\. \binom {0+5}{5} \times T(0) $$

for example $$T_2$$, the case we have at least two bad couples:

$$\binom {5}{2} \ $$ - stands for the choice of the two couples considered

$$2! \ $$ - the order of the two bad pairs matter

$$\binom {6+2}{2} \ $$ - the two couples are separators for the rest of 6 digits (bin bar)

$$T(6)\ $$ - is just the number of filling the 6 remaining slots

The required number is, by inclusion-exclusion :

$$T(10) - T_1 + T_2 - T_3 + T_4 - T_5 = 39480$$