
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 the sequence $\{a_n\}$ with the sum of its first $n$ terms denoted as $S_n$, where $$S_{n}= \begin{cases} 2^{n}-1,&& n\leq 4 \\ -n^{2}+(a-1)n,&& n\geq 5,\end{cases}$$ find the expression for $a_n$; if $a_5$ is the maximum value in $\{a_n\}$, determine the range of the real number $a$.

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