Limitations on the difference of coprime composites less than $n^2$ for ascertaining primality?

54 Views Asked by At

Let $q$ be a prime where $n < q < n^2$.

Let $p_1, p_2, \ldots, p_k$ be all the primes $\leq n$.

Is it true that for any $q$, you can find two numbers $a,b$ where $a+b=q$ or $a-b=q$, such that $p_k \# \mid ab$, and where each $p_{i\leq k}$ divides exactly one of $a$ or $b$?

For example, let $q=83$. One solution would be

$$\begin{align}a= 2^2 \cdot 5 \cdot 7^2 \cdot 17 \cdot 23=383180 \\ b= 3\cdot 11 \cdot 13 \cdot 19 \cdot 47=383097\end{align}$$

where $a-b=83$. In this example, since every prime through $23$ is represented in one term or the other, any difference we can obtain below $29^2$ will automatically be a prime. I'll grant this is not stunningly efficient, but I'm still left wondering whether constructions like this are possible for arbitrarily large primes.

It's probably worth mentioning that it is also possible to use the same approach with more than two terms; if we are adding $r$ terms, it works so long as every $p_{i\leq k}$ is present in exactly $r-1$ of them.

1

There are 1 best solutions below

2
On BEST ANSWER

You can do this with any partition of the primes among $a$ and $b$. Choose any subset of the primes $p_1, p_2, \ldots, p_k$ and let their product be $x$. Also, have the product of the non-chosen primes be $y$. Note if no primes are chosen for a value, then use $1$. Thus, $xy = p_k \#$.

Since $\gcd(x,y) = 1$, Bézout's identity states there are integers $c,d$ such that

$$cx + dy = 1 \tag{1}\label{eq1}$$

As stated in the linked page, you can use a method like the Extended Euclidean algorithm to determine a pair of $c$ and $d$ for \eqref{eq1}.

Note $\gcd(c,y) = 1$, so no primes which divide $y$ divide $c$, and likewise $\gcd(d,x) = 1$ so no primes which divide $x$ divide $d$. Next, multiply both sides by the prime $q$ to get

$$qcx + qdy = q \tag{2}\label{eq2}$$

$$a = qcx \; \text{ and } \; b = qdy \tag{3}\label{eq3}$$

Thus, $a + b = q$, $p_k \# \mid ab$, and each $p_{i\leq k}$ divides exactly one of $a$ or $b$.

There are actually an infinite number of $a$ and $b$ values which work. Let

$$f = e(p_k \#), \; e \in \mathbb{Z} \tag{4}\label{eq4}$$

$$a_1 = a + f \; \text{ and } \; b_1 = b - f \tag{5}\label{eq5}$$

You have, as before, that $x \mid a_1$, $\gcd(y, a_1) = 1$, $y \mid b_1$ and $\gcd(x, b_1) = 1$. Thus, $a_1 + b_1 = q$, $p_k \# \mid a_1 b_1$, and each $p_{i\leq k}$ divides exactly one of $a_1$ or $b_1$. If you prefer to not have $q$ be a factor of $a_1$ or $b_1$, just choose $e$ in \eqref{eq4} so $q \not\mid e$.