
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given that $p$ and $q$ (where $q \neq 0$) are real numbers, and the equation $x^{2}-p x+q=0$ has two real roots $\alpha$ and $\beta$. The sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=p$, $a_{2}=p^{2}-q$, and $a_{n}=p a_{n-1}-q a_{n-2}$ for $n=3,4, \cdots$.
(1) Find the general term formula for the sequence $\left\{a_{n}\right\}$ in terms of $\alpha$ and $\beta$.
(2) If $p=1$ and $q=\frac{1}{4}$, find the sum of the first $n$ terms of $\left\{a_{n}\right\}$.

Present the answer in LaTex format: \boxed{Your answer}
user