
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 $(1+x) + (1+x)^2 + \ldots + (1+x)^n = a_0 + a_1x + a_2x^2 + \ldots + a_nx^n$, and $a_1 + a_2 + \ldots + a_{n-1} = 29 - n$, then $n = \_\_\_\_\_\_$.

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