Find all $m\ge 2$ such that $\phi(n,m)\ge (m-n)\phi(1,m)/m$ and $m^2\mid 2022^m+1$

contest-mathdivisibilityelementary-number-theorygcd-and-lcmtotient-function

Let $m,n$ be two positive integers such that $n<m$. Define $$\phi(n,m)=|\{n\le k\le m : (k,m)=1\}|$$
Find all $m\ge 2$ such that
$$\text{(i)}\quad \frac{\phi(n,m)}{m-n}\ge \frac{\phi(1,m)}{m} \forall 1\le n\le m-1$$
$$\text{(ii)}\quad m^2\mid 2022^m+1$$

First the two conditions seem unrelated for me. I think they did this just to eliminate a lot of possibilities for $m$.

Let's start with $\text(i)$, it is equivalent to $$\frac{\phi(n,m)}{(m-n)}\ge \frac{\phi(m)}{m}$$
Since I can't get a explicit formula for $\phi(n,m)$ (Which I think it probably doesn't exists) I tried to take $m$ to a prime $p$, we get $$\phi(n,p)=p-n\ge (p-n)\frac{p-1}{p}$$ Which is always true. So we've got a solution for $\text{(i)}$; it's true for every prime . Unfortunately the sides of the inequality aren't multiplicative (aside from $\phi(m)$ and $m$) so we can't guarantee the inequality by verifying $m=p^a$ furthermore the case where $m=p^a$ is a bit complicated and I couldn't check it.

Now $\text{(ii)}$. First you can see that any even $m$ won't work. Now assume that $p$ is the smallest prime divisor of $m$ then $$p\mid (2022^{m}+1)(2022^m-1)=2022^{2m}-1$$ and we also know that $(p,2022)=1$ because otherwise we would get $p\mid 1$ so we use Fermat to get $$p\mid 2022^{p-1}-1=43\cdot 47\cdot 7\cdot 17^2$$
Hence $$2022^{(2m,p-1)}-1=2022^2-1$$ because of the minimality of $p$ . Hence $m=7k, 17k, 43k$ or $47k$ Now I don't know how to finish this and even how is $\text{(i)}$ related to $\text{(ii)}$.

Best Answer

You've made a good start, but note that, as explained below, the factors of $2022 - 1 = 43(47)$ don't apply. To finish, first define

$$\alpha(n,m)=|\{1\le k\le n-1 : (k,m)=1\}| \tag{1}\label{eq1A}$$

This then gives

$$\begin{equation}\begin{aligned} \phi(n,m) & = |\{1\le k\le m : (k,m)=1\}| - |\{1\le k\le n-1 : (k,m)=1\}| \\ & = \phi(1,m) - \alpha(n,m) \end{aligned}\end{equation}\tag{2}\label{eq2A}$$

Since $\phi(1,m)=\phi(m)$, as you've noted, then using \eqref{eq2A}, the first problem condition becomes

$$\begin{equation}\begin{aligned} \frac{\phi(m) - \alpha(n,m)}{m-n} & \ge \frac{\phi(m)}{m} \\ m(\phi(m) - \alpha(n,m)) & \ge (m - n)(\phi(m)) \\ -m\alpha(n,m) & \ge -n\phi(m) \\ \frac{\alpha(n,m)}{n} & \le \frac{\phi(m)}{m} \end{aligned}\end{equation}\tag{3}\label{eq3A}$$

Let $p_1$ be the smallest prime factor of $m$. If $m$ has at least $2$ distinct prime factors then, with $n = p_1$, the left side of \eqref{eq3A} becomes $\frac{p_1-1}{p_1} = 1 - \frac{1}{p_1}$. However, using Euler's product formula, the right side of \eqref{eq3A} becomes $\prod_{p\mid m}\left(1 - \frac{1}{p}\right) \lt 1 - \frac{1}{p_1}$, contradicting the inequality in \eqref{eq3A}.

Thus, $m$ can have only one distinct prime factor, so for some integer $a \ge 1$,

$$m = p_1^a \tag{4}\label{eq4A}$$

The RHS of \eqref{eq3A} is thus $1 - \frac{1}{p_1}$. For the LHS, consider $n \gt 0$ with $n = sp_1 + t$, $0 \le s \lt p_1^{a-1}$ and $0 \le t \lt p_1$. With $t = 0$, then $s \ge 1$ with there being $s-1$ multiples of $p_1$ less than $n$, which means $\frac{\alpha(n,m)}{n} = \frac{(n - 1) - (s - 1)}{n} = \frac{n-s}{n} = 1 - \frac{s}{sp_1} = 1 - \frac{1}{p_1}$, so \eqref{eq3A} holds. Alternatively, with $1 \le t \le p_1 - 1$, then $\frac{\alpha(n,m)}{n} = \frac{(n - 1) - s}{n} = 1 - \frac{s + 1}{sp_1 + t} \lt 1 - \frac{s + 1}{sp_1 + p_1} = 1 - \frac{s+1}{(s+1)p_1} = 1 - \frac{1}{p_1}$, so \eqref{eq3A} also holds in this case.

This means all $a \ge 1$ satisfy \eqref{eq4A}. Next, the second required condition is

$$m^2 \mid 2022^m + 1 \; \to \; m^2 \mid 2022^{2m}-1 \tag{5}\label{eq5A}$$

Thus, the multiplicative order of $2022$ modulo $p_1$ must divide $2m$, i.e.,

$$(r = \operatorname{ord}_{p_1}(2022)) \mid 2p_1^{a} \tag{6}\label{eq6A}$$

However, as you've already indicated, since $2022^{p_1-1}\equiv 1\pmod{p_1}$, then $r \mid p_1 - 1$. Thus, as you've already stated, from \eqref{eq6A} we have $r \mid (\gcd(2p_1^{a},p-1) = 2)$, i.e., $r$ must be $1$ or $2$. It can't be $1$ since then $p_1 \mid 2022^{m} - 1$, contradicting the LHS of \eqref{eq5A}, so it must be $2$. This means

$$p_1 \mid (2022 - 1)(2022 + 1) \tag{7}\label{eq7A}$$

We can't have $p_1 \mid 2022 - 1$ since then $r = 1$, which has already been discarded, so $p_1 \mid 2022 + 1$. Next, the Lifting-the-exponent lemma, \eqref{eq4A} and the LHS of \eqref{eq5A} gives

$$\begin{equation}\begin{aligned} \nu_{p_1}(2022^{m}+1) & = \nu_{p_1}(2022 + 1) + \nu_{p_1}(m) \\ & = \nu_{p_1}(2022 + 1) + a \\ & \ge 2a \end{aligned}\end{equation}\tag{8}\label{eq8A}$$

This means $\nu_{p_1}(2022 + 1) \ge a$. Since $2022 + 1 = 7(17^2)$, we have either $p_1 = 7$, which gives $m = 7$, or $p_1 = 17$, which gives $m = 17$ or $m = 17^2 = 289$. Thus,

$$m \in \{7, 17, 289\} \tag{9}\label{eq9A}$$

are the only values of $m \ge 2$ which satisfy both of the problem conditions.

Related Question