Step 1: Formula for sum of coefficients of even powers
For a polynomial \( p(x) = 1 - x + x^2 \), the sum of coefficients of even powers in \( p(x)^m \) is:
\[
S_{\text{even}} = \frac{p(1)^m + p(-1)^m}{2}.
\]
\[
p(1) = 1 - 1 + 1 = 1, \quad p(-1) = 1 - (-1) + 1 = 3.
\]
For the exponent \( m = 2n \):
\[
p(1)^{2n} = 1^{2n} = 1, \quad p(-1)^{2n} = 3^{2n},
\]
\[
S_{\text{even}} = \frac{1 + 3^{2n}}{2}.
\]
Step 2: Solve for \( n \)
Given the sum is 3281:
\[
\frac{1 + 3^{2n}}{2} = 3281 \implies 1 + 3^{2n} = 6562 \implies 3^{2n} = 6561,
\]
\[
3^{2n} = 6561 = 3^8 \implies 2n = 8 \implies n = 4.
\]
\[
\Rightarrow n = 4.
\]