
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 $\left\{ a_n \right\}$ is an arithmetic sequence, where $a_1=31$ and $a_4=7$

$(1)$ Find the general formula for the sequence $\left\{ a_n \right\}$.

$(2)$ From which term does the sequence $\left\{ a_n \right\}$ start to be less than $0$?

$(3)$ Does the sum of the first $n$ terms of the sequence $\left\{ a_n \right\}$, $S_n$, have a maximum or minimum value? If it does, find this value.

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