
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
In an arithmetic sequence $\{a_n\}$, $a_3+a_4=15$ and $a_2a_5=54$, with a common difference $d<0$.  
$(1)$ Find the general term formula $a_n$ for the sequence $\{a_n\}$.  
$(2)$ Find the maximum value of the sum of the first $n$ terms, $S_n$, and the corresponding value of $n$.

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