Given an integer $n>2$ and an integer $a$, if there exists an integer $d$ such that $n\mid a^d-1$ and $n\nmid a^{d-1}+\cdots+1$, we say $a$ is $n-$separating. Given any n>2, let the defect of $n$ be defined as the number of integers $a$ such that $0<a<n$, $(a,n)=1$, and $a$ is not $n-$separating. Determine all integers $n>2$ whose defect is equal to the smallest possible value.
Problem
Source: Turkey National Mathematical Olympiad 2019, Problem 6
Tags: number theory, number theory unsolved, number theory proposed
24.12.2019 20:28
Let $n=p_1^{\alpha_1}\cdots p_k^{\alpha_k}$. I claim $n$ enjoys this condition if and only if for every $i$ and $j$, $$ p_i^{\alpha_i}\nmid p_j-1. $$ The solution I present is kind of long. But if impatient, the gist is cases $({\rm c}),({\rm d}),({\rm e})$, the first two cases are mere warm-ups. Given any integer $n>2$, let $$ S_n = \{a:1\leqslant a\leqslant n-1,(a,n)=1, \exists d:n\mid a^d-1,n\nmid a^{d-1}+\cdots+1\}. $$Now, let $D_n$ be the set of all $(a,n)=1$, $a\in[1,n-1]$ such that $a$ is not $n-$separating. Then, {\em defect} of $n$ is simply $|D_n|$. Note that, $D_n\cap S_n=\varnothing$ and $D_n\cup S_n=\{a:1\leqslant a\leqslant n-1,(a,n)=1\}$, which has cardinality $\varphi(n)$, where $\varphi(n)$ is Euler's totient function. Hence, the problem is equivalent to finding all $n$ such that, $|S_n|$ is maximum possible value. Now, we observe that, $$ S_n\subseteq \{a:1\leqslant a\leqslant n-1,(a,n)=1,(a-1,n)>1\}\triangleq T_n. $$Indeed, suppose $a$ is such that $(n,a(a-1))=1$. Then, if $n\mid a^d-1=(a-1)(a^{d-1}+\cdots+1)$, since $(n,a-1)=1$, we have $n\mid a^{d-1}+\cdots+1$, for every such $d$, hence $a$ is {\bf not} $n-$separating, that is, $a\notin S_n$. ${\rm (a)}$ We first show primes achieve this. Indeed, let $n=p$ be a prime. Note that, $T_n = \{1\}$. Now, if $a=1$, one can simply take $d$ such that $p\nmid d$. If $a\neq 1$, then $p\mid a^d-1=(a-1)(a^{d-1}+\cdots+1)$, together with $a<1$ yield $p\mid a^{d-1}+\cdots+1$, and thus, $a\notin S_n$. ${\rm (b)}$ Prime powers also achieve this maximum. Indeed, let $n=p^\ell$ for some prime $p>2$. Now, if $a\in T_n$ then $p\mid a-1$. Moreover, $1\leqslant v_p(a-1)\leqslant \ell-1$. Now, using lifting the exponent lemma, $$ v_p(a^d-1)=v_p(a-1)+v_p(d). $$In particular, if $d=p^{\ell-v_p(a-1)}$ is selected, then $p^\ell\mid\mid a^d-1$ and $p^\ell\nmid a^{d-1}+\cdots+1$. Hence, $S_n=T_n$. ${\rm (c)}$Now, let $n$ be a composite number, that is, $$ n=p_1^{\alpha_1}\cdots p_k^{\alpha_k}, $$where $p_1<p_2<\cdots<p_k$ are primes. Suppose, in addition, that $(p_i,p_j-1)=1$ for every $1\leqslant i,j\leqslant k$. We claim that every $a\in T_n$ also belongs to $S_n$, and thus the defect of $n$ is also minimal. To show this, let $I\subseteq \{1,2,\dots,k\}$ be such that, $p_i\mid a-1$ if $i\in I$. We will now cook up a suitable exponent $d$. Again, recalling lifting the exponent lemma, $v_{p_i}(a^d-1)=v_{p_i}(a-1)+v_{p_i}(d)$, for every $i\in I$, and in particular, $$ v_{p_i}(a^{d-1}+\cdots+1)=v_{p_i}(d). $$Now, if $v_{p_i}(a-1)<\alpha_i$, then simply select $v_{p_i}(d)=\alpha_i-v_{p_i}(a-1)$ (and observe that with this choice, $v_{p_i}(d)<\alpha_i$, and thus $n\nmid a^{d-1}+\cdots+1$), and if $v_{p_i}(a-1)\geqslant \alpha_i$, then we immediately have $p_i^{\alpha_i}\mid a^d-1$ for every $d$, and thus, it suffices to ensure $v_{p_i}(d)<\alpha_i$. In either case, let $v_{p_i}(d)=\beta_i$. To enforce this constraint, we need to make sure, $$ d\equiv p_i^{\beta_i}\pmod{p_i^{\beta_i+1}},\quad\forall i\in I. $$Now, let $j\in \{1,2,\dots,k\}\setminus I$. For these numbers, we clearly have $p_j\nmid a-1$. Thus it suffices to select $d$ such that $a^d\equiv 1\pmod{p_j^{\alpha_j}}$. Observe that by Euler's theorem, if $\varphi(p_j^{\alpha_j})\mid d$ then this condition holds. Combining, it suffices to take: $$ d\equiv p_i^{\beta_i}\pmod{p_i^{\beta_i+1}},\forall i\in I\quad\text{and}\quad d\equiv 0\pmod{\varphi(p_j^{\alpha_j})}. $$Since $(p_i,p_j-1)=1$ for every $i,j$ (assumption above), such a $d$ indeed exists by the Chinese remainder theorem. Hence, $a\in T_n\Rightarrow a\in S_n$. ${\rm (d)}$Now we extend the case above a bit more. Suppose again that $$ n=p_1^{\alpha_1}\cdots p_k^{\alpha_k}, $$with the property that for every $i,j$, $p_i^{\alpha_i}\nmid p_j-1$. In particular, for every fixed $i$, $$ \max_{1\leqslant j\leqslant k}v_{p_i}(p_j-1) \leqslant \alpha_i-1. $$Now, take any $a\in T_n$ as above in case $({\rm c})$. Define again $I=\{i:p_i\mid a-1\}$, and now set $p_i^{\alpha_i-1}\mid\mid d$ for every $i\in I$, and $\varphi(p_j^{\alpha_j})\mid d$ for every $d$. Clearly, such a $d$ exists by the CRT, and for this $d$, $n\mid a^d-1$, while $n\nmid a^{d-1}+\cdots+1$. ${\rm (e)}$ Now, we are in the last case. Suppose, $$ n=p_1^{\alpha_1}\cdots p_k^{\alpha_k}, $$however, there is an $i,j$ such that $p_i^{\alpha_i}\mid p_j-1$ (note that, $p_j>2$). Now, let $g_j$ be primitive roots modulo $p_j^{\alpha_j}$, for every $j\neq i$. Take $a\in T_n$, where $$ a\equiv 1\pmod{p_i^{\alpha_i}}\quad\text{and}\quad a\equiv g_j\pmod{p_j^{\alpha_j}}, $$for every $j\neq i$. Clearly, such an $a$ exists due to CRT. Now, take any $d$ with $n\mid a^d-1$. In particular, inspecting modulo $p_j^{\alpha_j}$, we have: $$ p_j-1\mid d. $$Observe moreover that, $$ \frac{n}{p_i^{\alpha_i}}\mid a^{d-1}+\cdots+1. $$Now, recall that $v_{p_i}(a^{d-1}+\cdots+1)=v_{p_i}(d)\geqslant v_{p_i}(p_j-1)\geqslant \alpha_i$. In particular, $p_i^{\alpha_i}\mid a^{d-1}+\cdots+1$. Since $\left(p_i^{\alpha_i},\frac{n}{p_i^{\alpha_i}}\right)=1$, we then conclude that, $$ n\mid a^d-1\Rightarrow n\mid a^{d-1}+\cdots+1, $$for every $d$, and therefore, for this value of $a\in T_n$, $a\notin S_n$, that is, $$ S_n\subsetneq T_n. $$This completes the characterization of all such $n$.
24.12.2019 20:29
I did sweep what happens with prime $2$ under the rug, but I hope that is minor issue to be fixed, if creates any problem at all.
30.12.2019 05:22