A sequence $S_n$ $(n>1)$ of integer number pairs $$ S_n=(1,j_1)(i_2,j_2)\dots(i_k,j_k)\dots(i_K,n) $$ is admissible if for all $k$: 1) $1\le i_k,j_k\le n$; 2) $i_{k+1}=j_{k}$; and 3) $(-1)^k (i_k-j_k)>0$.
To be found is the total number of different admissible sequences with given numbers $N_{ij}$ of occurrences of each pair in the sequence.
Any hint would be appreciated.