
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 that the sum of the coefficients in the expansion of $(a^2+1)^n$ (where $a \neq 0$) is equal to the constant term in the expansion of $\left( \frac{16}{5}x^2+ \frac{1}{\sqrt{x}} \right)^5$.  
(1) Find the value of $n$;  
(2) If the term with the maximum coefficient in the expansion of $(a^2+1)^n$ is equal to 54, find the value of $a$.

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