
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
Find all pairs  $(a, p)$  of positive integers, where  $p$  is a prime, such that for any pair of positive integers  $m$  and  $n$  the remainder obtained when  $a^{2^n}$  is divided by  $p^n$  is non-zero and equals the remainder obtained when  $a^{2^m}$  is divided by  $p^m$ .

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