8. Given a positive integer $n$, a finite sequence of positive integers $a_{1}, a_{2}, \cdots, a_{m}$ is called an “$n$-even sequence”:

if $n=a_{1}+a_{2}+\cdots+a_{m}$, and there are an even number of integer pairs $(i, j)$ such that $1 \leqslant i \leqslant m$ and $i \leqslant j$ and $ia_{j}$. Find the number of $n$-even sequences. For example, there are six 4-even sequences: $4 ; 1,3 ; 2,2 ; 1,1,2 ; 2,1,1 ; 1,1,1,1$.
8. A finite sequence of positive integers $a_{1}, a_{2}, \cdots, a_{m}$ is called an "n-sequence" if and only if $n=a_{1}+a_{2}+\cdots+a_{m}$; if an n-sequence is not an n-even sequence, it is called an "n-odd sequence".

Let $S(n)$ be the difference between the number of n-even sequences and n-odd sequences, and define $S(0)=1$.
We will prove that for $n \geqslant 1$,
$$
S(n)=1+\sum_{k=1}^{\left[\frac{n}{2}\right]} S(n-2 k).
$$

In fact, n-sequences can be classified as follows:
(when $n=1$, only the (i) category exists; when $n=2$, only the (i) and (iii) categories exist).
(i) $a_{1}=n$.
The difference between the number of n-even sequences and n-odd sequences in this category is 1.
(ii) n-sequences satisfying $a_{1} \neq a_{2}$.
Notice that, for an n-sequence $a_{1}, a_{2}, a_{3}, \cdots, a_{m}$, the sequence $a_{2}, a_{1}, a_{3}, \cdots, a_{m}$ has a different parity. Thus, in n-sequences satisfying $a_{1} \neq a_{2}$, the number of n-odd sequences and n-even sequences is the same.
(iii) n-sequences satisfying $a_{1}=a_{2}$.
In n-sequences where $a_{1}=a_{2}=k\left(1 \leqslant k \leqslant\left[\frac{n}{2}\right]\right)$, since the sequence $a_{1}, \cdots, a_{m}$ and the sequence $a_{3}, \cdots, a_{m}$ have the same parity, the difference between the number of n-even sequences and n-odd sequences is exactly $S(n-2 k)$.
Note: When $n=2 k$, $S(0)=1$ corresponds to the sequence: $k, k$.
Combining (i), (ii), and (iii), we know that equation (1) holds.
From equation (1), we know that for $n \geqslant 3$,
$$
\begin{array}{l}
S(n)-S(n-2) \\
=\sum_{k=1}^{\left[\frac{n}{2}\right]} S(n-2 k)-\sum_{k=1}^{\left[\frac{n}{2}-1\right]} S(n-2 k) \\
=S(n-2) \\
\Rightarrow S(n)=2 S(n-2).
\end{array}
$$

When $n=2$, we also have $S(2)=2=2 S(0)$.
Thus, when $n$ is odd,
$$
\begin{array}{l}
S(n)=1+S(1)+S(3)+\cdots+S(n-2) \\
=2^{\frac{n-1}{2}} ;
\end{array}
$$

When $n$ is even,
$$
\begin{array}{l}
S(n)=1+S(0)+S(2)+\cdots+S(n-2) \\
=2^{\frac{n}{2}} .
\end{array}
$$

Notice that, the n-sequence $a_{1}, a_{2}, \cdots, a_{m}$ corresponds one-to-one with the ordered tuple $\left(a_{1}, a_{1}+a_{2}, \cdots, a_{1}+a_{2}+\cdots+a_{m}\right)$, and the number of such tuples is equal to the number of subsets of the set $\{1,2, \cdots, n\}$ that contain $n$. Therefore, the total number of n-sequences is $2^{n-1}$.
Thus, the number of n-even sequences is
$$
\frac{2^{n-1}+S(n)}{2}=2^{n-2}+2^{\left[\frac{n}{2}\right]-1}.
$$