
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 $\left\{a_n\right\}$ satisfies $a_1= -\frac{1}{2}$, $a_{n+1}b_n=b_{n+1}a_n+b_n$, and $b_n= \frac{1+(-1)^n5}{2} \left(n\in\mathbb{N}^*\right)$, then when the sum of the first $2n$ terms of the sequence $\left\{a_n\right\}$, $S_{2n}$, reaches its maximum value, find the value of $n$.

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