
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 the geometric sequence $\{a_n\}$, $a_1=2$, $a_3$, $a_2+a_4$, $a_5$ form an arithmetic sequence.

$(1)$ Find the general formula for the sequence $\{a_n\}$;

$(2)$ If the sequence $\{b_n\}$ satisfies $b_1+\frac{b_2}{2}+...+\frac{b_n}{n}=a_n(n\in\mathbb{N}^*)$, and the sum of the first $n$ terms of $\{b_n\}$ is $S_n$, find the maximum positive integer $n$ for which $S_n-na_n+6\geqslant 0$ holds.

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