
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 each prime  $p$ , let  $\mathbb S_p = \{1, 2, \dots, p-1\}$ . Find all primes  $p$  for which there exists a function  $f\colon \mathbb S_p \to \mathbb S_p$  such that
\[ n \cdot f(n) \cdot f(f(n)) - 1 \; \text{is a multiple of} \; p \]
for all  $n \in \mathbb S_p$ .

*Andrew Wen*

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