# Generating prime $\ p_{n+1}\$ (the complete version)

Let $$\ p_n\$$ be the consecutive primes starting with $$\ p_0:=2.\$$ Let $$\ M(n)\$$ be the multiplicative monomial generated by $$\ \{p_k:\ k=0\ldots n\}\$$ (of course $$\ 1\in M(n)$$).

Could you prove or disprove:

$$\forall_{n\in\mathbb Z_0}\, \exists_{K\ L\in M(n)} \ \left( \prod_{k=0}^n p_k|K\cdot L\ \text{and}\ p_{n+1}=L-K\right).$$

• $3=4-1$, $5=6-1=2.3-1$, $7=10-3=2.5-3$, $11=21-10=3.7-2.5$, $13=55-42=5.11-2.3.7$, $17=182-165=2.7.13-3.5.11$, $19=1020-1001=2^2.3.5.17 - 7.11.13$, $23= 22253-22230= 7.11.17^2-2.3^2.5.13.19$, $29 = 2437149- 2437120 =3.11.13^2.19.23-2^{12}.5.7.17$
– YCor
Jan 18, 2023 at 8:38
• In other words, the task is to find an integer at which the quadratic polynomial $X^2+pX$ evaluates to an integer whose radical is exactly the product of all primes $<p$. That's quite a thin set to hit, my first uneducated guess would be that it's not always possible. Jan 18, 2023 at 10:19
• See Guy, Lacampagne, and Selfridge, Primes at a Glance, Math Comp 48, #177, January 1987, 183-202, ams.org/journals/mcom/1987-48-177/S0025-5718-1987-0866108-3/… and the followup Agoh, T., Erdős, P., & Granville, A. (1997). Primes at a (Somewhat Lengthy) Glance. The American Mathematical Monthly, 104(10), 943–945. doi.org/10.2307/2974476 Jan 18, 2023 at 22:35
• Very probably 31 can't be written this way. Indeed, let $M$ be the mult. monoid generated by the ten primes $<31$. The following was checked after computing the 20835814 elements $\le 10^{17}$ in $M$. In $M$ the number of pairs $(n,n+31)$ is 336, and for all of them $n<10^9$ (only two have $n>10^7$, the largest being $n=658897169$ with $n=7^3.17^4.23$ and $n+31=2^4.3^3.5^2.13^2.19^2$). Actually the gaps in $M$ tend to increase: for $n\ge 10^k$, $k=8\dots,14$ the gaps are $\ge 1,6,57,183,541,3787,35706$. ($k=8$ corresponds to $n=177182720=2^{11}.5.11^3.13$, $n+1= 3^6.17^2.29^2$). (...)
– YCor
Jan 19, 2023 at 14:23
• (...) Heuristic arguments indicate that it is very unlikely to have a solution above $10^{17}$, just because $M$ is too sparse: not sure of a good estimate, but a crude one is that the number of elements $\le m$ in $M$ is $\le \log(m)^{10}/\prod_{p<31}\log(p)$ and for $m\ge 10^{17}$ this is already a proportion $\le 10^{-4}$ (a better estimate should give $\le 10^{-9}$, since $M\cap [0,10^{17}]|= 20835814<10^8$).
– YCor
Jan 19, 2023 at 14:23

Assuming that the triple $$(a,b,c)=(2,3^{10}\cdot 109,23^5)$$ found by Eric Reyssat is the one with the highest quality $$q=\log(c)/\log(\text{rad}(abc))=1.6299\ldots$$ for the ABC conjecture, one quickly computes that there is indeed no solution for $$p_{n+1}=31$$. Setting $$Q=\text{rad}(KLp_{n+1})=\prod_{k=0}^{n+1}p_k$$, we get $$\log(L)\le q\log(Q)$$. Running through the possibilities for these $$L$$ with prime factors $$\le29$$, one checks that $$K=L-p_{n+1}$$ either has prime factors $$\ge31$$, or $$\prod_{k=0}^{n}p_k$$ does not divide $$K\cdot L$$.

The (naive) pure python code which runs about 20 seconds on my machine for $$p_{n+1}=31$$ (which is $$q$$ in the third line) is

from math import prod, floor, factorial

q = 31

a = [z for z in range(2, q) if factorial(z-1)%z == z-1] # primes < q
P = prod(a)
qual = 1.63
c = floor((q*P)**qual) # upper bound for L

def La(K, a): # check if all prime divisors of K are in a
for p in a:
while K%p == 0:
K //= p
return K == 1

def indent(i): # Create iterator for candidates of L
return ' '*(4*i)
s = 'def tmp():\n'
s += '    c0 = c\n'
s += '    x0 = 1\n'
for i in range(len(a)):
s += indent(i+1) + f'b{i} = 1\n'
s += indent(i+1) + f'while b{i} <= c{i}:\n'
s += indent(i+2) + f'x{i+1} = x{i}*b{i}\n'
s += indent(i+2) + f'c{i+1} = c{i}//b{i}\n'
s += indent(i+2) + f'b{i} *= a[{i}]\n'
s += indent(len(a)+1) + f'yield x{len(a)}\n'
exec(s)
f = tmp()

for L in f:
K = L-q
if (K*L)%P == 0:
if La(K, a):
print(K, L)
break
else:
print('no solution')

• I don't see your answer as a solution. Jan 19, 2023 at 21:22
• Yes, but it was too long for a comment. In addition, I now added the code. Jan 19, 2023 at 21:39
• @WlodAA In all fairness, nonexistence of solutions for these kind of questions (with unknowns in the exponents) is usually very hard, if not impossible to prove unconditionally. What you have here is at least a very explicit way of saying that any possible solution would have to be a more spectacular constellation of prime powers than anything known at present. Jan 20, 2023 at 15:54
• @JoachimKönig, thank you for your kind comment. My question was what has occurred to me a very long time ago but indeed the odds are against a positive answer. Nevertheless, I have related constructions/conjectures even if all of them are likely to be answered in negative. Jan 21, 2023 at 6:11
• @WlodAA Baker's "explicit abc conjecture" expects the bound $c\le\frac{6}{5}r\frac{\log(r)^\omega}{\omega!}$, where $r$ is the radical of $abc$, and $\omega$ is the number of prime factors of $r$. Even with this weaker bound, the (adapted) code from the answer shows within a few seconds that there is no solution for $p_{n+1}=31$ (and $37$, $41$, $43$). So a positive answer to your question for these primes would contradict Baker's conjecture. Jan 22, 2023 at 20:26