
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
For an integer \( n \geq 3 \), we say that \( A = \left( a_1, a_2, \ldots, a_n \right) \) is an \( n \)-list if every \( a_k \) is an integer in the range \( 1 \leq a_k \leq n \). For each \( k = 1, \ldots, n-1 \), let \( M_k \) be the minimal possible non-zero value of \( \left| \frac{a_1 + \ldots + a_{k+1}}{k+1} - \frac{a_1 + \ldots + a_k}{k} \right| \), across all \( n \)-lists. We say that an \( n \)-list \( A \) is ideal if
\[ \left| \frac{a_1 + \ldots + a_{k+1}}{k+1} - \frac{a_1 + \ldots + a_k}{k} \right| = M_k \]
for each \( k = 1, \ldots, n-1 \).
Find the number of ideal \( n \)-lists.

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