
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 a sequence $\{a_n\}$ where each term is non-zero and the sum of the first $n$ terms is $S_n$, with $a_1=1$ and $S_n=pa_na_{n+1}$ ($n\in\mathbb{N}^*$), $p\in\mathbb{R}$.  
(1) If $a_1$, $a_2$, $a_3$ form a geometric sequence, find the value of the real number $p$;  
(2) If $a_1$, $a_2$, $a_3$ form an arithmetic sequence,  
   ① Find the general formula for the sequence $\{a_n\}$;  
   ② Insert $n$ positive numbers between $a_n$ and $a_{n+1}$ to form a geometric sequence with a common ratio of $q_n$. If the inequality $(q_n)^{(n+1)(n+a)}\leqslant e$ holds for any $n\in\mathbb{N}^*$, find the maximum value of the real number $a$.

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