I realize this has been asked for the more general $p/q$ case; however, I am restricting myself to the case of $p=2$ and $q$ is odd (see the Rhind Mathematical Papyrus 2/n table).
It's easy to show that any fraction of the form $2/(2N+1)$ can be written as the fraction
$$\frac{2}{2N+1} = \frac{1}{N+1} + \frac{1}{(N+1)(2N+1)}$$
which appears to be optimal for prime numbers. However, I was trying to express the problem as an optimization problem (KKT) and am not getting a solution. I'm not sure if I'm formulating it correctly, or something else. The problem can be formulated as
$$f(x) = x_1 + x_2$$ $$g(x) = \frac{2}{2N+1} - \frac{1}{x_1} - \frac{1}{x_2} = 0$$ $$h(x) = [ 2-x_1 , x_1+1 - x_2 ]^T \le 0$$
This means the Lagrangian is
$$\mathcal{L} = x_1 + x_2 - \lambda \left[ (2N+1)(x_1+x_2)-2x_1x_2 \right] - \mu_1(2-x_1)-\mu_2(x_1+1 - x_2)$$
So the KKT conditions are
$$\frac{\partial \mathcal{L}}{\partial x_1} = \lambda (2 n - 2 x_2 + 1 )+1+\mu_1-\mu_2=0$$
$$\frac{\partial \mathcal{L}}{\partial x_2} = \lambda (2 n-2 x_1+1) + 1 +\mu_2 = 0$$
$$\mu_1 ( 2 - x_1 ) =0$$
$$\mu_1 \ge 0$$
$$\mu_2 ( x_1 + 1 - x_2 ) =0$$
$$\mu_2 \ge 0$$
$$\frac{2}{2N+1} =\frac{1}{x_1} + \frac{1}{x_2} = 0$$
Solving for $x_1$ and $x_2$
\begin{array}{c|c|c|c|c} \hline \mu_1>0 & \mu_2>0 & x_1=2 & x_2=3 & \mathrm{violates\ constraint} \\ \hline \mu_1>0 & \mu_2=0 & x_1=2 & x_2=6 & \mathrm{correct} \\ \hline \mu_1=0 & \mu_2>0 & x_1=n + \frac{1}{2} \sqrt{2+4n+4n^2} & x_2=x_1+1 & \mathrm{not\ a\ solution\ over\ the\ natural\ numbers} \\ \hline \mu_1=0 & \mu_2=0 & x_1=2n+1 & x_2=x_1 & \mathrm{violates\ constraint} \\ \hline \end{array}
So is this problem not suited for KKT? Have I done something incorrect?
Any guidance would be appreciated