Search Problems   RSS Feed
projecteuler.net

Order Modulo Factorial

 Published on Sunday, 29th June 2025, 02:00 am and solved by 402
Difficulty: Level 30 [77%]

Problem 952

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$.



Copied to Clipboard