
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 function $f(x)=2|x+2|-|x+1|$, and the infinite sequence $\{a_n\}$ with the first term $a_1=a$.
1. If $a_n=f(n)$ $(n\in\mathbb{N}^*)$, write the general formula for the sequence $\{a_n\}$.
2. If $a_n=f(a_{n-1})$ $(n\in\mathbb{N}^*)$ and $n\geqslant 2$, to make the sequence $\{a_n\}$ an arithmetic sequence, find the range of values for the first term $a$.
3. If $a_n=f(a_{n-1})$ $(n\in\mathbb{N}^*)$ and $n\geqslant 2$, find the sum of the first $n$ terms $S_n$ of the sequence $\{a_n\}$.

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