0

Let $p$ be a prime number and h be a natural number smaller than p. We set $n = ph + 1$. Prove that if $2^{n-1}-1$, but not $2^h-1$, is divisible by $n$, then $n$ is a prime number.

We have $n|2^{ph}-1, n\nmid 2^h-1\implies n|2^{p-1}h+2^{p-2}h+\dots+1$

If $n=l\alpha $ and $l $ is a prime.

We have $2^{n-1}-1\equiv 0\mod l$

So $2^{n-1}-1\equiv 0\mod l$

$2^{n-1}\equiv 1\mod l$

$2^{\alpha -1}\equiv 1\mod l$

$2^{l-\alpha}\equiv 1\mod l$

Bill Dubuque
  • 282,220
Raheel
  • 1,791

1 Answers1

4

We're given that

$$2^{n-1} \equiv 1 \pmod{n} \tag{1}\label{eq1A}$$

Let $k$ be the multiplicative order of $2$ modulo $n$, i.e.,

$$\operatorname{ord}_{n}(2) = k \tag{2}\label{eq2A}$$

From \eqref{eq1A}, we get

$$k \mid n - 1 \;\;\to\;\; k \mid ph \tag{3}\label{eq3A}$$

since, otherwise, there's integers $j$ and $r$ where $n - 1 = jk + r, \; \; 1 \le r \lt k$, which gives $2^{n-1} \equiv (2^{k})^j(2^r) \equiv 1(2^r) \pmod{n}$, so $2^r \equiv 1 \pmod{n}$, contradicting that $m = k$ is the smallest positive integer where $2^m \equiv 1 \pmod{n}$.

Since we're given that $k \not\mid h$, then this with \eqref{eq3A} means $p \mid k$, i.e., there's a positive integer $j$ where

$$k = jp \tag{4}\label{eq4A}$$

Also, the third paragraph of the Properties section states

As a consequence of Lagrange's theorem, the order of $a \pmod{n}$ always divides $\varphi(n)$.

Note $\varphi(n)$ is Euler's totient function, for which we have

$$\varphi(n) = \prod_{i=1}^{m}p_i^{e_i - 1}(p_i - 1) \;\;\text{where}\;\; n = \prod_{i=1}^{n}p_i^{e_i} \tag{5}\label{eq5A}$$

From \eqref{eq4A}, we have $k \mid \varphi(n) \;\to\; p \mid \varphi(n)$. Since $p \not\mid n$, then we must have $p \mid p_i - 1$ for some $i$, say WLOG $p_1$, so we get

$$p_1 = sp + 1 \tag{6}\label{eq6A}$$

for positive integer $s$. Thus, we have for some positive integer $t$ that

$$n = (sp + 1)t \;\to\; ph + 1 = tsp + t \;\to\; (h - ts)p = t - 1 \tag{7}\label{eq7A}$$

Note the stated condition $h \lt p$ means $n \lt p^2$, but $t \ge p$ means from \eqref{eq7A} that $n \gt p^2$, so we must have $t \lt p$. Since the right side of the above equation shows $p \mid t - 1$, then $t = 1$. Thus, $n = p_1$, i.e., it's a prime number.

John Omielan
  • 52,653
  • Great solution! Though I knew what orders were so thanks – Raheel Sep 21 '21 at 04:15
  • how did you get orders idea? – Raheel Sep 21 '21 at 04:16
  • 1
    @Raheel Thank you for the compliment. Whenever I see a problem involving something like $a^b \equiv 1 \pmod{c}$ for some positive integers $a$, $b$ and $c$, one of the first things I think of trying to use is the multiplicative order. This often, but by no means always, helps in some way. – John Omielan Sep 21 '21 at 04:19
  • @Raheel Note I've reread my answer, and I'm now unsure how I got my original sentence of "If $k \lt n - 1$, then $n - 1 = ph$ for some prime $p$ and $h = kq$ for some positive integer $q$". I didn't offer a proof and, although I don't have any specific examples where it's not the case, I suspect it's not always true. Instead, I've just updated my answer to, instead, just rigorously prove $p\mid k$, then use this along with the condition $h\lt p$ (note this is important, but my original answer didn't directly use it) to show $n$ must be prime. I apologize for my likely earlier mistake. – John Omielan May 18 '25 at 03:02
  • @Raheel A simple example where the multiplicative order, i.e., what I designate as $k$, is less than $n-1$ is with $p=3$ and $h=2$, so $n=ph+1=7$. In this case, $n\not\mid 2^h-1$, but $k=3\lt 6$. – John Omielan May 18 '25 at 12:33
  • @BillDubuque I reopened it because the problem asked in the question you closed this as a duplicate of is, although somewhat similar, different from this one in several important ways. First, this one requires just that $n$ doesn't divide one specific factor of $n-1$ as a power of $2$ minus $1$, i.e., $2^h-1$, rather than that of all strict divisors. Second, the problem here has a specific form of $n=ph+1$ where $h\lt p$ (with this form being important, of course, for solving it), while the other one doesn't. Third, the solution method, and results, are different. For example, in your ... – John Omielan May 19 '25 at 15:21
  • @BillDubuque (cont.) answer to the other question, you show that $k=n-1$, while my comment just above yours gives a simple example where that is not necessarily the case here, i.e., where $p=3$ and $h=2$ since $k=3$ as $n\mid 2^3-1$. For these reasons, I don't consider your proposed duplicate to be as such, and also with the differences I've noted, IMHO it doesn't even qualify as an abstract duplicate. Note, though, that before I reopened this question, I first did an ... – John Omielan May 19 '25 at 15:22
  • @BillDubuque (cont,) Approach0 search to see if I could find an appropriate duplicate myself, in which case I would have just changed the linked duplicate question. However, I was only able to find the AoPS threads n is prime if 2^{n-1}-1 and not 2^h-1 is divisible by n, where n = ph + 1 (which lists the source as being "$15$th -b QEDMO problem $9$ ($19$. - $22$. $10$. $2017$)" at ... – John Omielan May 19 '25 at 15:23
  • @BillDubuque (cont.) https://artofproblemsolving.com/community/c1512515_qedmo_2005), and the similar A problem about primes, which also allows $n=ap^2+1$. Nonetheless, if you let me know of an appropriate duplicate on this site, please let me know and I'll then close this question myself as being that duplicate. – John Omielan May 19 '25 at 15:24
  • 1
    I deleted my comment as soon as I noticed that the dupe link was not what I intended (before your above comments were posted). I'll try to relocate the intended link when some spare time arises. Apologies for the mixup. – Bill Dubuque May 19 '25 at 16:24
  • @BillDubuque No worries. Thanks for the explanation. – John Omielan May 19 '25 at 16:25