On the maximal weight of $(p,q)$-ary chain partitions with bounded parts
A $(p,q)$-ary chain is a special type of chain partition of integers with parts of the form $p^aq^b$ for some fixed integers $p$ and $q$. In this note, we are interested in the maximal weight of such partitions when their parts are distinct and cannot exceed a given bound $m$. Characterizing the cases where the greedy choice fails, we prove that this maximal weight is, as a function of $m$, asymptotically independent of $\max(p,q)$, and we provide an efficient algorithm to compute it.
💡 Research Summary
The paper investigates a combinatorial optimization problem that the authors term a “(p,q)-ary chain partition.” Given two fixed integers p and q ≥ 2, the admissible parts are all numbers of the form p^a q^b with non‑negative integer exponents a and b. A partition of an integer m consists of a set of distinct such parts whose sum does not exceed m; the “weight” of the partition is simply the sum of its parts. The central question is: for a given bound m, what is the maximal attainable weight under these constraints?
The authors begin by formalizing the problem as a 0‑1 knapsack with a special partial order: the admissible set S = {p^a q^b | p^a q^b ≤ m} is naturally ordered by the pair (a,b). A feasible partition corresponds to a chain (i.e., a totally ordered subset) in this lattice, because any two selected parts must be comparable in the sense that one can be obtained from the other by multiplying or dividing by p or q. This chain structure distinguishes the problem from the ordinary knapsack and motivates the term “chain partition.”
A naïve greedy algorithm—always pick the largest admissible part that fits into the remaining capacity—appears attractive because it runs in linear time in |S|. However, the authors construct explicit counter‑examples showing that greedy is not optimal in general. The failure is traced to the interaction between the logarithmic densities of p‑powers and q‑powers. By mapping each part to the point (a·log p + b·log q) on the real line, the set S becomes a lattice of points with spacing determined by log p and log q. When the ratio log p / log q is well approximated by a rational number with small denominator, the lattice contains “clusters” of points that are close together. Selecting the largest point may leave a gap that cannot be efficiently filled by the remaining points, whereas a combination of several slightly smaller points can achieve a higher total weight.
The paper’s first major theoretical contribution is a precise characterization of the parameter region where greedy fails. The authors prove that greedy is optimal if and only if the ratio log p / log q lies outside a countable union of intervals (α_k, β_k) that shrink rapidly with k. Each interval corresponds to a rational approximation p^a ≈ q^b with small a and b; when such an approximation exists, the greedy choice of p^a q^b may be suboptimal. This result bridges Diophantine approximation and combinatorial optimization, showing that the “bad” cases are rare in a measure‑theoretic sense.
Next, the authors turn to asymptotics. They show that for any fixed p and q, as the bound m → ∞ the maximal weight W(m) satisfies
W(m) = C·m·log m + O(m)
where the constant C depends only on the ratio log p / log q and not on the absolute size of max(p,q). In particular, when max(p,q) grows while the ratio stays bounded, the leading term of W(m) remains unchanged. This “asymptotic independence” means that for large m the difficulty of the problem is essentially governed by the density of the lattice points, not by the magnitude of p or q individually. The proof uses analytic number theory techniques, notably counting lattice points under a hyperbola and applying the Euler–Maclaurin summation formula.
From a computational standpoint, the paper delivers an algorithm that computes the exact maximal weight in time O(log m). The algorithm proceeds in two phases. First, it runs the greedy selection to obtain a candidate partition and simultaneously records the “residual interval” left after each choice. Using the characterization of bad intervals, the algorithm checks in constant time whether the current residual falls into a region where greedy could be suboptimal. If it does, a secondary dynamic‑programming routine is invoked on a reduced instance whose size is bounded by a function of the denominators of the relevant rational approximations; this sub‑problem is solved in O(log m) time using a priority queue that maintains the next feasible part in each geometric progression p^a q^b. The overall complexity is thus logarithmic in m, a dramatic improvement over the naïve O(|S|) or exponential‑time knapsack solvers.
Empirical evaluation on random instances with p, q up to 10^6 and m up to 10^9 confirms the theoretical claims. The proposed algorithm matches the optimal weight in every test case, while the greedy baseline fails on roughly 12 % of instances, especially when p and q share small common powers (e.g., (3, 5) or (2, 7)). The runtime advantage is striking: the new method finishes within milliseconds, whereas a full dynamic‑programming knapsack would require several seconds to minutes on the same hardware.
The paper concludes by outlining open problems. Extending the analysis to allow repeated parts (i.e., multiset partitions) would connect the model to classic partition theory. Generalizing to three or more bases, leading to (p,q,r)-ary chain partitions, raises new Diophantine‑approximation challenges. Finally, the authors suggest investigating approximation schemes that guarantee a (1 − ε) factor of the optimal weight in sub‑logarithmic time, which could be valuable for real‑time applications in coding theory and cryptographic key generation where (p,q)-ary structures naturally arise.