Let $a$ and $b$ be fixed positive integers. We say that a prime $p$ is fun if there exists a positive integer $n$ satisfying the following conditions: $p$ divides $a^{n!} + b$. $p$ divides $a^{(n + 1)!} + b$. $p < 2n^2 + 1$. Show that there are finitely many fun primes.
Problem
Source: Mexico National Olympiad Mock Exam 2021 P6
Tags: number theory
12.11.2021 08:24
Redacted Sorry I was being extremely dumb
12.11.2021 08:33
@above check your solution again. a^(m).a^(n)=a^(m+n), not a^(mn).
12.11.2021 08:33
There's no typo as far as I can tell. $a^{(n + 1)!}$ is not equal to $a^{n!} \cdot a^{n + 1}$.
12.11.2021 12:45
edit ......
12.11.2021 13:17
@above you are wrong again
12.11.2021 13:19
ok thank you
12.11.2021 21:36
Firstly, note that there are only finitely many primes $p$ such that $b \equiv -1 \mod p$, i.e. such that $p|b+1$. Furthermore, for any fixed $n$, there are only finitely many primes satisfying the conditions of the problem, so we can assume that $n$ is sufficiently large as well. Hence it is enough to show that there are finitely many primes $p$ satisfying both the conditions for some sufficiently large $n$ and that $b \not \equiv -1 \mod p$. For any such prime $p$, we immediately deduce that $a^{n!} \not \equiv 1 \mod p$. On the other hand, note that the two congruences imply that $a^{n \cdot n!} \equiv 1 \mod p$. Since the $k$ satisfying $a^k \equiv 1 \mod p$ are precisely the multiples of $ord_p(a)$, the first congruence implies that $ord_p(a) \nmid n!$ while the second implies that $ord_p(a) \mid n(n!)$. This immediately implies that there exists some prime $q \mid n$ such that $v_q(ord_p(a))>v_q(n!)$. We now show that this implies that $ord_p(a)>2n^2$ for $n$ composite. Note that $q^{v_q(ord_p(a))} \geq q^{v_q(n!)+1}=qn^{\log_n(q)v_q(n!)}$. If $n \geq 3q$, then $\log_n(q)v_q(n!) \geq \frac{\frac{n}{\log(n)}}{\frac{q}{\log(q)}} \geq 2\frac{\log(3)}{\log(2)}\frac{\log(\frac{n}{3})}{\log(n)}>2$ for $n$ large, invoking the monotonicity of the function $\frac{x}{\log(x)}$ for $x>e$. Hence $qn^{\log_n(q)v_q(n!)}>qn^2 \geq 2n^2$, as desired. If $n=2q$, then we simply have that $q^{v_q(n!)+1} \geq (\frac{n}{2})^3$, which surpasses $2n^2$ for $n>16$. This solves the case of $n$ composite because we have that $ord_p(a)|p-1$ by Fermat's Little Theorem, so $p>ord_p(a)>2n^2$. In the case of $n=q$, we immediately get that $q^2|p-1$, and for $n>2$, this means that $2q^2|p-1$, so we conclude that $p>2n^2$ in this case as well.
12.11.2021 21:43
Let's nail this nice problem. In what follows, I make use of asymptotic order notation: we say $f(n) =O(n^k)$ if there is a $C>0$ such that for every $n$ $f(n)\le Cn^k$; $f(n)=\Omega(n^k)$ if there is a $C>0$ such that $f(n)\ge Cn^k$ for all $n$; and $f(n)=o(n^k)$ if $f(n)n^{-k}\to 0$ as $n\to\infty$. First, if $p\mid a$, then the claim is immediate; hence assume $p\nmid a,b$. Notice that \[ a^{n!}\equiv (a^{n!})^{n+1}\pmod{p} \implies p\mid a^{n\cdot n!}-1. \]Now, let $d$ be the order of $a$ modulo $p$. That is, $d$ is the smallest positive integer so that $p\mid a^d-1$. By Fermat's theorem, $p\mid a^{p-1}-1$, hence $d\mid p-1$. If $d\mid (n+1)!$ then $a^{(n+1)!}\equiv 1\pmod{p}$, forcing $p\mid b+1$; and there are clearly finitely many such primes as $b$ is fixed. Hence, assume $d\nmid (n+1)!$. Moreover, we have $d\mid n\cdot n!$, $d\mid p-1$ and $p<2n^2+1$. Now, there are few casework we have to handle. Note that if we can show $n$ must be upper bounded by an absolute constant, we will be done automatically. Case 1: $n$ is a prime. In this case, if $v_n(d)=1$ then $d/n \mid n!$ and thus $d\mid (n+1)!$ as $d/n$ is coprime to $n$, hence the given condition is not possible. Thus $v_n(d)\ge 2$, thus $d=kn^2$ for some $k$. Since $d\mid p-1$, we must therefore have $p=k\ell n^2+1$ for some $k,\ell\in\mathbb{N}$. Since $p<2n^2+1$, we are left with $k=\ell=1$, thus $p=n^2+1$. Unless $n=2$ and $p=5$, this is not possible since $n^2+1$ is even. Case 2: $n$ is composite. In this case, there is a prime $q\mid n$ such that $v_q(d)\ge v_q(n!)+1$ and $d<2n^2$. We then obtain \[ q^{v_q(n!)+1}\le q^{v_q(d)}\le d <2n^2, \]and since $q\ge 2$, we obtain \[ q^{v_q(n!)}<n^2. \]Now note that $n/q-1<v_q(n!) <n/(q-1)$. Hence, $v_q(n!)\ge n/2q$ as $q\mid n$ and $n$ is not a prime. This brings us \[ q^{\frac{n}{2q}}<n^2 \implies \frac{n}{2} \cdot \frac{\log q}{q} <2\log n. \]Now if $q<\sqrt{n}$ then using the fact $\ln x/x$ is decreasing, it follows \[ \frac{n}{4}\cdot \frac{\log n}{\sqrt{n}}<2\log n, \]which is clearly false for $n$ large. Next, assume $q>\sqrt{n}$. If $n\ge 8q$ then $q^{n/2q}>n^2$, again a contradiction. Thus we are left with $n=kq$ with $k\in\{2,\cdots,7\}$. If $n\ge 5q$ then $q^{n/2q} = \Omega(n^{2.5}) = o(n^2)$. If $n=3q,4q$ then going back to $q^{v_q(n!)}<n^2$ we have $v_q(n!) = 3$ for $n=3q$ and $q^{v_q(n!)} = \Omega(n^3)=o(n^2)$. Finally, for $n=2q$, $d\mid n\cdot n!$ and $d\nmid (n+1)!$ implies $q^3\mid d$, which together with $d\mid p-1<2n^2$ again implies $d=O(n^2)$ but $d=\Omega(n^3)$, which is again clearly impossible.
13.11.2021 08:56
This problem was proposed by my fun self
20.04.2024 04:18
Solution from Twitch Solves ISL: We will consider $n > 2^{100}$, since this adds at most finitely many primes. We also assume $p \nmid ab$ throughout, as well as $p > b+1$. Note that we have \[ a^{n!} \equiv -b \pmod p \implies a^{n!} \not\equiv 1 \pmod p \]because we assume $p > b+1$. However, we also get \[ a^{n \cdot n!} \equiv 1 \pmod p. \]Thus, if $e$ denotes the order of $a \pmod p$, then $e \nmid n!$, but $e \nmid n \cdot n!$. So there exists a prime $q$ with $q \mid n$ such that \[ \nu_q(n!) < \nu_q(e) \le \nu_q(n!) + \nu_q(n). \]We also know that \[ e \mid p-1 < 2n^2. \] Claim: We have $n = q$. Proof. Assume not, meaning $q \le n/2$. Start by using the estimate \[ n^{2.1} > 2n^2 > q^{\nu_q(e)} \ge q^{\nu_q(n!)+1} \ge q^{\frac nq + 1}. \]In particular, we certainly need $n^{2.1} \ge q^3$, so $q < n^{0.7}$. Using that, we can further estimate \[ n^{2.1} \ge 2^{\frac nq + 1} \ge 2^{n^{0.3} + 1} \]which is false for $n > 2^{100}$. $\blacksquare$ So $e$ must be a multiple of $n^2$, but $e < 2n^2$, so in fact $e = n^2$ exactly. That means $p = n^2+1$. However $p$ and $n$ are both primes, so this is a contradiction. Remark: The same proof shows there are finitely many fun primes if the condition $a,b > 0$ is relaxed to $a$ and $b$ are nonzero integers with $b \neq -1$.
21.04.2024 12:54
v_Enhance wrote: Solution from Twitch Solves ISL: We will consider $n > 2^{100}$, since this adds at most finitely many primes. We also assume $p \nmid ab$ throughout, as well as $p > b+1$. Note that we have \[ a^{n!} \equiv -b \pmod p \implies a^{n!} \not\equiv 1 \pmod p \]because we assume $p > b+1$. However, we also get \[ a^{n \cdot n!} \equiv 1 \pmod p. \]Thus, if $e$ denotes the order of $a \pmod p$, then $e \nmid n!$, but $e \nmid n \cdot n!$. So there exists a prime $q$ with $q \mid n$ such that \[ \nu_q(n!) < \nu_q(e) \le \nu_q(n!) + \nu_q(n). \]We also know that \[ e \mid p-1 < 2n^2. \] Claim: We have $n = q$. Proof. Assume not, meaning $q \le n/2$. Start by using the estimate \[ n^{2.1} > 2n^2 > q^{\nu_q(e)} \ge q^{\nu_q(n!)+1} \ge q^{\frac nq + 1}. \]In particular, we certainly need $n^{2.1} \ge q^3$, so $q < n^{0.7}$. Using that, we can further estimate \[ n^{2.1} \ge 2^{\frac nq + 1} \ge 2^{n^{0.3} + 1} \]which is false for $n > 2^{100}$. $\blacksquare$ So $e$ must be a multiple of $n^2$, but $e < 2n^2$, so in fact $e = n^2$ exactly. That means $p = n^2+1$. However $p$ and $n$ are both primes, so this is a contradiction. Remark: The same proof shows there are finitely many fun primes if the condition $a,b > 0$ is relaxed to $a$ and $b$ are nonzero integers with $b \neq -1$. Hey, your solution is very nice! But just one thing shouldn't it be $e \nmid n!$ but $e \mid n \cdot n!$.
21.04.2024 13:02
I dont think so....