**Edit 2018.12.06**

I have not yet found an explicit result regarding sets of coprimes In an interval. Erdos and Sarkozy in a 1993 article On sets of coprime integers in intervals establish several results which confirm the qualitative result, that for every $k$ there is an interval length $d(k)$ (their Theorem 7 uses $n$ where I use $d$) which guarantees at least $k$ coprimes in any interval of length $d(k)$. However, the error terms they use suggest $d(k) \gt 2^k$, whereas I am confident one can bring $d(k)$ down to near Jacobsthal's $C(k)$. So I claim that asymptotically, $g(n,k) \in \Theta((n/k)^k)$, and that it remains to show that for each $k$ and for all $n$ greater than (say) $k^5$, $2*g(n,k) \gt (n/k)^k$.

**End Edit 2018.12.06.**

**Edit 2018.11.24**

The post below is too long. The short version is that the claim that $g(n,k)$ is like $(n/k )^k$ does hold for fixed $k$ and sufficiently large $n$, primarily because there is an interval of length $d$ ($d$ not depending on $n$) which contains $n/k$ and $k$ mutually coprime numbers summing to at most $n$. The post will be updated later with details. The main change is to pick numbers $m$ from the interval In order of decreasing $L(m)$, and the details are to show you can do this to get $k$ coprimes, which I will post later.

**End Edit 2018.11.24.**

This question is taking me down an old path with a new perspective. I will relate the perspective to the problem, and then share the perspective.

The (perspective is motivated by a goal, and the) goal is to show there are $k$ numbers near $n/k$ which are mutually coprime, and really to show that 'near' is independent of $n$. For small values of $k$, it is easy to show this independence: for values of $k=1$ through $6$: (and larger) one has at least $k+1$ coprimes (my abbreviation for numbers which are pairwise coprime) in any interval of length $g(P_k)$. So to solve the version of the problem where you pick $k$ coprimes which sum to at most $n$, and $k$ is small, there is guaranteed a rather tight grouping in an interval around $n/k$, although $n/k$ may need to be slightly above the average to keep the sum from exceeding $n$.

(One way to show independence of $n$ is to consider an alternative problem: Fix $d$, and count coprimes in each interval of length $d$. The minimum value $M_d$ of the maximum sized subset of coprimes in an interval of length $d$ exists, does not decrease as $d$ grows, and this minimum value repeats with a period dividing the product of all primes at most $d$. To show that $M_d$ eventually exceeds $k$ is possible, but a simple argument requires $d$ being superexponential in $k$. However, in general I do not know what $M_d$ is given $d$.)

The problem where the sum of these $k$ coprimes is exactly $n$ is more challenging. If we extend the interval slightly, we may replace some coprimes with numbers which bring the sum to exactly $n$ (and still have these numbers mutually coprime to the other members). Although I believe this interval length will also be independent of $n$, I do not have an idea of how to prove such independence. (Actually, one idea is to bump up $d$ to get a set of $k+j$ coprimes in the interval and show that there are enough subsets of size $k$ to guarantee a sum of $n$, but I am seriously unclear as to the size of $j$.) Even so, there are enough primes that having one or two members a distance of, say, $O((\log n)^2)$ away from $n/k$ will still keep $g(n,k)$, the generalization of Landau's function, comfortably close to $(n/k)^k$. Incidentally, by showing this product is at least half of $(n/k)^k$, one confirms that a solution to the general problem (with $k$ small with respect to $n$) involves such a set of coprimes.

So what is the plan? To start, pick an interval of length $d$ containing $n/k$. If we find this choice does not work, we may increase $d$ and extend the interval in one or in both directions. For each integer $m$ in the interval, record $L(m)$, the least prime factor dividing $m$. (We assume $n$ comfortably large, say $n/k \gt k^2$. For smaller $n$ we may as well look at Landau's function directly.)

$L(m)$ is 2 for about half the numbers $m$ in the interval. If $d=P_j$, the product of the first $j$ primes, then for $0 \lt i \lt j$ we have $p_{i+1}$ appear about $\phi(P_i)/(P_i p_{i+1})$ fraction many times as a value for $L(m)$ in this interval. Asymptotically this is like $O(1/(p_i\log i))$. Indeed, this fraction is a good approximation for a few larger $i$ as well, but variations in the distribution of numbers with large $L(m)$ values in an interval appear, and one cannot rely on this estimate for $i$ that much larger. (I would not trust it for $i \gt j + j^{\epsilon}$.). One thing we can rely on: if $L(m)$ assumes $k$ distinct values in this interval, then there are at most $k$ coprimes in this interval. This is because any set of coprimes far away from 0 must have distinct values for $L(m)$. And for small values of $k$, one can show that there are exactly $k$ coprimes, and for values of $d$ not much larger than $k$ (certainly $d \leq k^2$ for small $k$).

It is tempting to conjecture that if there are $k$ many distinct $L(m)$ values in an interval of length $d$ far away from zero, there will be $k$ coprimes in that interval. However, I think it is possible for large $k$ to have the following situation: pick $k-1$ odd coprimes, and find that every even number has a factor in common with one of the odd coprimes. If this does happen, $k$ will have to be larger than 10, possibly larger than 24, so we will not see small counterexamples of this form.

Anyway, to handle this bit of ignorance, we increase $d$. We expand it so that when we collect more values of $L(m)$, we collect enough (maybe $2k$ many?) so that we pick the numbers with the $k$ largest distinct $L(m)$ values, and hope these numbers are mutually coprime.

Things look promising. For if we have $r$ and $s$ odd numbers with distinct $L$ values, if they have a common prime factor $p$, then $2p \lt d$, and so both $L$ values must be less than $d/2$. So if we get $k$ numbers with distinct $L$ values $d/2$ or larger, then we are guaranteed a coprime set. Unfortunately, there are cases where we are not guaranteed any $L$ values greater than $d/2$. (An easy example with at most 2 such $L$ values greater than $d/2$ is an interval centered around 0, or centered around the product of all the primes at most $d/2$.).

This post is getting too long. I will hand wave in this paragraph. So pick $d$ larger than the $k$th prime as follows: we look for primes greater than some prime $q$ so that there are at least $k$ of them and the sum of the reciprocals of these primes is at most 1/2. We ignore numbers with $L$ values $q$ or less. We have picked $d$ so that there are plenty of numbers left (say $k(log k)^2$ many). Now pick a number with the smallest $L$ value $p$ which is greater than $q$ as one of the coprime. This removes about $1/p$ of the remaining numbers from consideration, but let us pretend it removes $2/p$ fraction of these numbers. Now pick the next number with smallest remaining $L$ value for the next coprime, and eliminate from consideration all other numbers with that prime factor. Because $q$ is large enough, we can repeat this up to $k$ times before running out of numbers. There is more work to do, and this gives a weak bound, but it shows that $d$ exists for a given $k$ with $M_d$ at least $k$. I will add more to give an asymptotic for $d$ in terms of $k$, which will achieve the goal in a qualitative sense.

Gerhard "Let's Make This Turkey Fly!" Paseman, 2018.11.23