Fix $\{w\_n\}\_n$ a sequence of positive real numbers, fix positive integers $N,K$, and fix $\eta>1$. I'm looking for a sequence of integers $\{k\_n\}\_n$ optimizing the following problem:


$$
\begin{aligned}
\min \sum\_{i=1}^n \frac{w\_i}{k\_i} \\
\mbox{s.t.}\\
\sum\_{i=1}^n k\_ik & = K\\
i^{\eta} w\_i & \leq k\_{i} \qquad \mbox{ for } i=1,\dots,n\\
N & \leq n
\end{aligned}
$$


Are such problems studied? How to go about it? Since usually $n$ is bounded...



Maximizing the length of a sequence under constraints
Presuming $k\_i$ are constrained to be positive (which I'm assuming to be the case), this can be solved as a Mixed-Integer Second Order Cone Program (MISOCP). Specifically, the reciprocal in the objective function can be handled by use of a rotated Second Order Cone constraint for each term in the objective function. 


I will assume that the "k" in the first constraint is either extraneous (i.e., a typo), or is a constant - in either case, that constraint would be linear. Presumably the "constraint" $N \le n$ isn't really a constraint, but a statement about the input values $N$ and $n$; but $N$ doesn't even appear. So I'll handle the essence of what I think the problem is, and assume the rest can be handled by fixing typos in the problem statement.


If a convex optimization modeling tool, such as CVX, CVXPY, or CVXR is used, handling of the reciprocal can be accomplished with a high level function (such as CVX's `inv_pos`), resulting in an under the hood transformation to SOCP formulation.


Here is CVX code (assume `w` is a column vector whose ith element is $w\_i$), and let `kk` take the role of `k` in the 1st constraint, because I am using `k` as a (column) vector whose ith element is $k\_i$.



```
cvx_begin
variable k(n) integer
minimize(w'*inv_pos(k))  % inv_pos(k) is vector of 1/k_i
subject to
kk*sum(k) == K
(1:n)'.^eta.*w <= k % this is a vector of n constraints
cvx_end

```

This requires an MISOCP solver, such as Gurobi or Mosek, or if using CVXPY, also CPLEX. Depending on the the input data, it may take a while for the solver to solve it (it is NP-hard, but only because of the integer constraint).


Here is how the reformulation to SOCP constraint works. The term $w\_i/k\_i$ is handled by introducing a new variable $t\_i$, changing the term $w\_i/k\_i$ to $w\_it\_i$, and introducing the rotated second order cone constraint (to enforce $t\_i = w\_i/k\_i$, accomp0lished via epigraph formulation due to minimization driving the inequality to be satisfied with equality at the optimum): $$\|1\|\_2 \le \sqrt{k\_it\_i}, t\_i \ge 0, k\_i \ge 0$$


