5. Given the sequence $\left\{a_{n}\right\}$ satisfies: $a_{1}=1, a_{n}=2 a_{n-1}+n-2(n \geqslant 2)$, then the general term $a_{n}=$
5. $a_{n}=2^{n}-n$ Detailed explanation: From the given, it is easy to see that $a_{n}+n=2\left[a_{n-1}+(n-1)\right],(n \geqslant 2)$, let $b_{n}=a_{n}+n$, then $b_{1}=a_{1}+1=2 ; b_{n}=2 b_{n-1},(n \geqslant 2)$, thus $b_{n}=2 \cdot 2^{n-1}=2^{n}$, that is $a_{n}+n=2^{n},(n \geqslant 2)$, hence $a_{n}=2^{n}-n$ $(n \geqslant 2)$, since $a_{1}=1$ also satisfies the above formula, so $a_{n}=2^{n}-n$.