10. (20 points) Let the sequence $\left\{a_{n}\right\}$ satisfy for all positive integers $n$,
$$
1+\sum_{m=1}^{n} \mathrm{C}_{n}^{m} a_{m}=2^{\frac{n}{2}} \cos \frac{n \pi}{4} .
$$

Find the general term formula of the sequence $\left\{a_{n}\right\}$.
10. After calculation,
$$
a_{1}=0, a_{2}=-1, a_{3}=0, a_{4}=1, a_{5}=0 .
$$

Conjecture: $a_{n}=\frac{\mathrm{i}^{n}+(-\mathrm{i})^{n}}{2}$.
Assume that for $n=1,2, \cdots, k$, the conjecture is:
$$
a_{n}=\frac{\mathrm{i}^{n}+(-\mathrm{i})^{n}}{2} \text {. }
$$

Then $1+\sum_{m=1}^{k+1} \mathrm{C}_{k+1}^{m} a_{m}=2^{\frac{k+1}{2}} \cos \frac{(k+1) \pi}{4}$, with the convention $a_{0}=1=\frac{\mathrm{i}^{0}+(-\mathrm{i})^{0}}{2}$.
Thus $\sum_{m=0}^{k+1} \mathrm{C}_{k+1}^{m} a_{m}=2^{\frac{k+1}{2}} \cos \frac{(k+1) \pi}{4}$
$\Rightarrow \sum_{m=0}^{k+1} \mathrm{C}_{k+1}^{m} \frac{\mathrm{i}^{m}+(-\mathrm{i})^{m}}{2}+a_{k+1}-$
$\frac{\mathrm{i}^{k+1}+(-\mathrm{i})^{k+1}}{2}$
$=2^{\frac{k+1}{2}} \cos \frac{(k+1) \pi}{4}$.
And $\sum_{m=0}^{k+1} \mathrm{C}_{k+1}^{m} \frac{\mathrm{i}^{m}+(-\mathrm{i})^{m}}{2}$
$=\frac{1}{2}\left((1+\mathrm{i})^{k+1}+(1-\mathrm{i})^{k+1}\right)$
$=\frac{(\sqrt{2})^{k+1}}{2}\left(\mathrm{e}^{\frac{(k+1) \pi}{4}} \mathrm{i}+\mathrm{e}^{-\frac{(k+1) \pi}{4} \mathrm{i}}\right)$
$=2^{\frac{k+1}{2}} \cos \frac{(k+1) \pi}{4}$,
Thus $2^{\frac{k+1}{2}} \cos \frac{(k+1) \pi}{4}+a_{k+1}-\frac{\mathrm{i}^{k+1}+(-\mathrm{i})^{k+1}}{2}$ $=2^{\frac{k+1}{2}} \cos \frac{(k+1) \pi}{4}$.
Hence $a_{k+1}=\frac{\mathrm{i}^{k+1}+(-\mathrm{i})^{k+1}}{2}$.
Therefore, the conjecture holds for $n=k+1$.
By mathematical induction, it is known that for all positive integers $n$, $a_{n}=\frac{\mathrm{i}^{n}+(-\mathrm{i})^{n}}{2}$.