Problem 952
Order Modulo Factorial
Given a prime $p$ and a positive integer $n \lt p$, let $R(p, n)$ be the multiplicative order of $p$ modulo $n!$.
In other words, $R(p, n)$ is the minimal positive integer $r$ such that
$$p^r \equiv 1 \pmod{n!}$$
For example, $R(7, 4) = 2$ and $R(10^9 + 7, 12) = 17280$.
Find $R(10^9 + 7, 10^7)$. Give your answer modulo $10^9 + 7$.
模阶乘的阶
给定质数$p$和正整数$n \lt p$,记$R(p, n)$为$p$模$n!$的阶。
换句话说,$R(p, n)$是满足下式的最小正整数$r$:
$$p^r \equiv 1 \pmod{n!}$$
例如,$R(7, 4) = 2$,$R(10^9 + 7, 12) = 17280$。
求$R(10^9 + 7, 10^7)$,并对$10^9 + 7$取余作为你的答案。