For a natural number $K$, I want to choose $n$ pairwise coprime numbers all of which are bigger than $K$ such that the distance $d$ between the smallest and the largest one is minimal.
For example, for any $K$ if $n=2$ we get $d=1$.
Similarly for any $K$ if $n=3$ then $d=2$.
I need a formula for such $d$ depending on $K$ and $n$. I do not need to know what those coprime numbers are.
Any help is appreciated.
A short observation: $d$ only depends on $n$.
Indeed, if you can find some integers $k_1,..,k_n$ like in the problem for some $K$, then for all $m$ the numbers $(\prod (k_j-k_i))^m+k_i$ are also integers like in the problem.
Indeed if $d| (\prod (k_j-k_i))^m+k_l$ and $d|(\prod (k_j-k_i))+k_s$ then, by taking the difference $d| k_l-k_s$ and hence $d| \prod (k_j-k_i)$. It follows that $d| gcd(k_l, k_s)=1$.
Now, by picking $m$ large enough, you can create numbers as large as you want.
So the question is actually equivalent to the following: For each $n$, which is the smallest possible difference between the largest and smallest numbers among $n$ coprime numbers?
It is clear that $d \leq p_{n-1}$, but this is an upperbound which can probably be improved.