
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
Let m be a positive interger, let  $p$  be a prime, let  $a_1=8p^m$ , and let  $a_n=(n+1)^{\frac{a_{n-1}}{n}}$ ,  $n=2,3...$ . Determine the primes  $p$  for which the products  $a_n(1-\frac{1}{a_1})(1-\frac{1}{a_2})...(1-\frac{1}{a_n})$ ,  $n=1,2,3...$  are all integral.

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