Four. (20 points) Given the sequence $\left\{a_{n}\right\}$, $S_{n}$ represents the sum of its first $n$ terms. If it satisfies the relation $S_{n}+a_{n}=n^{2}+3 n-1$, find the general formula for the sequence $\left\{a_{n}\right\}$, i.e., the expression for $a_{n}$.