$\text{lcm}(1,2,3,4,5,6,7) = 420$ and this number is placed between two Twin primes: $419,\ 421$. This happens again for $\text{lcm}(1,2,3...19) = 232792560$ and $\text{lcm}(1,2,3,4,...,47)=442720643463713815200$ that is placed between the 2 Twin primes: $$442720643463713815199 \\ 442720643463713815201$$ However it does not happen again up to where I could reach about $\text{lcm}(1,2,3..., 44983).$
Is $N=47$ the largest number such that $\text{lcm}(1,2,3,...,N)$ is placed between two Twin primes?
I find this huge gap between 47 and, at least, 44983, highly counter-intuitive. There could be a good reason for this.
Complete list : $$\text{lcm}(1,2,3) = 6 \text{ Twin primes: 5 7}$$ $$\text{lcm}(1,2,3,4) = 12 \text{ Twin primes: 11 13}$$ $$\text{lcm}(1,2,3,4,5) = 60 \text{ Twin primes: 59 61}$$ $$\text{lcm}(1,2,3,4,5,6) = 60 \text{ Twin primes: 59 61}$$ $$\text{lcm}(1,2,3,4,5,6,7) = 420 \text{ Twin primes: 419 421}$$ $$\text{lcm}(1,2,3,...,19) = 232792560 \text{ Twin primes: 232792559 232792561}$$
(then 47 already mentioned above)
I also add a very simple code in python, using the sympy library, so everyone can verify this.
from sympy import *
lcmi=2
for i in range(3,100000):
print "Evaluating lcm of first", i, "numbers"
ni= lcm(lcmi,i)
if ni != lcmi:
if isprime(ni-1) and isprime(ni+1):
print i,"lcm:", ni,"Twin primes:", ni-1, ni+1
lcmi=ni
Write $a_n := \operatorname{lcm}(1, 2, \ldots, n)$.
When you're looking at $n=7$ you're considering the pair $420\pm 1$. The form of these numbers excludes the prime factors 2, 3, 5, and 7, and $\sqrt{420} \approx 20.5$, so the only potential remaining prime factors are 11, 13, 17, and 19.
On the other hand, when you're looking at, say, $n = 9$, you're considering $2520\pm 1$, and $\sqrt{2520} \approx 50.2$. The form of these numbers still excludes only 2, 3, 5, and 7 as prime factors, but now in addition to 11, 13, 17, and 19 you have to worry about 23, 27, 29, 31, 37, 41, 43, and 47.
Now $a_n = e^{n + o(n)}$ (see Chebyshev's function), so the number of primes less than $\sqrt{a_n}$ grows faster than linear in $n$, while the number of primes less than $n$ (i.e. the number of primes excluded as factors of $a_n \pm 1$) grows slower than linearly.
As a result, going only by this we'd expect exactly the sort of behavior you see here: true for all sufficiently small $n$, and then sporadically true for a few larger numbers if the pieces fall into place.
Of course that doesn't prove anything, but it does tell us that the numerical evidence here isn't pointing towards anything unusual, and therefore likely gives us no help in trying to prove or disprove that there are infinitely many $n$ for which $a_n \pm 1$ are relatively prime.