
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  $p$  be an odd prime number, and let  $\mathbb{F}_p$  denote the field of integers modulo  $p$ . Let  $\mathbb{F}_p[x]$  be the ring of polynomials over  $\mathbb{F}_p$ , and let  $q(x) \in \mathbb{F}_p[x]$  be given by  $q(x) = \sum_{k=1}^{p-1} a_k x^k$  where  $a_k = k^{(p-1)/2}$  mod  $p$ . Find the greatest nonnegative integer  $n$  such that  $(x-1)^n$  divides  $q(x)$  in  $\mathbb{F}_p[x]$ .


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