3

I came across the article titled Hyperbolic Primality Test and Catalan–Mersenne Number Conjecture. I tried to implement their Hyperbolic Primality Test:

If there exists a non-trivial $x$ satisfying $$ 2^{p-1} + x \equiv 0 \pmod{2x+1} \text{,} $$ then $2^p - 1$ is prime. Here, the trivial solutions are $x = 0$ and $2^{p-1} - 1$.

My implementation is written in C using libgmp. The problem is, whenever I found $x$ satisfying the above congruence, $2^p - 1$ is composite (not a prime number, as the article claims).

Can you try it too, to see if I made a mistake somewhere? Or is there a mistake in the article? Any feedback is welcome.

Bill Dubuque
  • 282,220
DaBler
  • 1,111
  • 1
    There's an obvious typo - it should say "no nontrivial" vs. "a nontrivial". I removed some tags since this has nothing to do with them - it is simply a rephrasing of the definition of a prime in the odd case - see my answer. Beware that there are many very low quality papers on preprints.org. $\ \ $ – Bill Dubuque Dec 21 '24 at 02:41

2 Answers2

4

It's trivial:$ $ put $\,a = 2^{p-1}\,$ in this rewriting of the definition of an odd prime $\,q=2a-1$:

$\quad\begin{align}{2a-1}\ {\rm is\ prime}&\iff (2x+1\mid \color{#0a0}{2a-1}\,\Rightarrow\, 2x+1 = 2a-1\,\ {\rm or}\,\ 1)\\[.4em] &\iff \bbox[3px,border:1px solid #c00]{2x+1\mid \,\color{#0a0}{a\,+\,x} \,\ \ \Rightarrow\ \ \ \ x\ =\ a-1\ \ \ {\rm or}\ \ \ 0\,} \end{align}$

because $\bmod 2x\!+\!1\!:\ \color{#0a0}{2a\equiv 1\!\iff\! a\equiv -x}\,$ (by scaling by $\,2^{-1}\equiv -x,\,$ by $\,2(-x)\equiv 1)$.

Bill Dubuque
  • 282,220
2

It seems there is a typo in the article. It likely meant instead something like that if there are no (rather than "a") non-trivial $x$ satisfying the specified congruence equation, then $2^p-1$ is prime. This is also suggested in the article text where, between its equations $(5)$ and $(6)$, it states that

So, if there exists any integer lattice point on the hyperbola, $M_p$ is not prime.

There's a fairly simple and direct way to show this compared to what's used in the linked article. Since $\gcd(2, 2x + 1) = 1$ (so $2^{-1} \equiv x + 1 \pmod{2x + 1}$), we have

$$\begin{equation}\begin{aligned} 2^{p-1} + x & \equiv 0 \pmod{2x+1} \iff \\ 2^{p} + 2x & \equiv 0 \pmod{2x+1} \iff \\ 2^{p} - 1 & \equiv 0 \pmod{2x+1} \end{aligned}\end{equation}$$

If $2^{p} - 1$ is prime, then the only positive values of $2x + 1$ which work are $2x + 1 = 1 \;\to\; x = 0$ and $2x + 1 = 2^{p} - 1 \;\to\; x = 2^{p-1} - 1$, i.e., what are considered to be the trivial solutions. Thus, if there are any non-trivial solutions, then $2^p - 1$ cannot be prime, i.e., it's composite as you've determined. In particular, each factor of $2^p - 1$, with $1 \lt f \lt 2^p - 1$, has a solution of $f = 2x + 1$ (e.g., for $p = 4$ with $2^4 - 1 = 15$, we have the solutions of $2x + 1 = 3$ (so $x = 1$) and $2x + 1 = 5$ (so $x = 2$)).

John Omielan
  • 52,653
  • This has nothing to do with integers of the form $,2^p-1.,$ Rather it simply a trivial rewriting of the definition of an odd prime (irreducible) integer, as I explain in my answer. – Bill Dubuque Dec 20 '24 at 20:58