Manuscript Offprint
arXiv:2608.30036A note on the -completeness of the Frobenius number
A note on the -completeness of the Frobenius number
Thomas Rothvoss*
Abstract
Given a finite set of natural numbers whose greatest common divisor is one, the Frobenius number is the largest integer that is not a non-negative integer combination of the numbers in . In a 2016 preprint, Matsubara states that given and , deciding if is -complete. A decade has passed since without peer-reviewed publication of this result. At the same time, the community has found it difficult to verify this result. In this note, we give a write-up of the completeness proof based on Matsubara (2016).
Remark 1. The author used OpenAI's GPT 5.6 Sol to decode the proof of [Mat16]. The writing here is 100% due to the author. The author takes no intellectual credit; the sole purpose of this note is to clarify the complexity status of computing the Frobenius number.
*University of Washington, Seattle. Email: rothvoss@uw.edu. Supported by NSF grant 2318620 AF: SMALL: The Geometry of Integer Programming and Lattices.
In fact, Schur gave an explicit bound: if , then all integers are -representable.
For definiteness, we set if .
not {5, 6}-representable but every larger integer is {5, 6}-representable. The Frobenius number has an intuitive interpretation as the coin problem: given a coin system with different denominations , find the largest amount that cannot be paid exactly using such coins.
In a landmark paper, Kannan [Kan89, Kan92] proved that for any fixed , there is a polynomial time algorithm to compute for sets with . In fact, Kannan solves the more general problem of computing the covering radius for any rational polytope in polynomial time as long as is constant. However, this note focuses on the complexity-theoretic aspects of the Frobenius number. For that purpose we define a decision variant of the Frobenius problem in the form of the language
Ramírez-Alfonsín [RA96] proved that FROB is NP-hard under Turing reductions. This result was followed by Matsubara giving the exact classification:
Theorem 1 (Matsubara [Mat16]). FROB is -complete.
However, at the time of this writing, no formal publication of [Mat16] is available and the writing makes verification difficult The purpose of this note is to clarify the proof of [Mat16].
2 Preliminaries
We recap the necessary complexity theory background. We recommend the standard textbook by Arora and Barak [AB09] for more details. For , we use . A language is any set of strings . The complexity class is the set of languages that can be written in the form
where and are polynomials and is a deterministic polynomial time algorithm. Analogously, is the set of languages
We note that is the complementary class to in the sense that . Both classes generalize to and which have alternating
In a Turing reduction one is allowed to use polynomially many oracle calls of FROB.
See e.g. the discussion in https://cstheory.stackexchange.com/questions/42499/computational-complex quantifiers and the union forms the polynomial hierarchy PH.
For two languages we write if there is a polynomial-time computable map so that
This is also called a Karp-reduction. We say that a language is -hard if for every one has . Moreover is -complete if (i) and (ii) is -hard. Analogously we define -completeness. The relation is transitive and so in order to prove say -hardness of , it suffices to take any -hard problem and show that . A suitable hard problem will be the following:
Quantified 3-dimensional matching (Q3DM). Given disjoint sets with and sets of hyperedges with . Decide if for all there is a set so that the union is a perfect matching.
Here, an edge is actually a hypergraph edge with . As usually, a set is called a perfect matching if for all there is precisely one edge with . Spelling out the order of the quantifiers we can write
We rely on the following classical result by McLoughlin:
Theorem 2 (McLoughlin [McL84]). The language Q3DM is -complete.
3 The main result
Since Q3DM is in rather than , we work with the complementary Frobenius language
Technically speaking this is not the precise set-theoretic complement of FROB as neither contains strings that are not syntactically valid instances. But that difference is a polynomial time recognizable subset and hence it can be ignore for complexity purposes. This is standard procedure, see e.g. [AB09].
As discussed above, is -complete if and only if is -complete. Hence it suffices to show the following:
Theorem 3. is -complete.
Proof. We know that from the characterization in (1) together with the fact that can be computed in polynomial time and the observation that Schur's Theorem gives an explicit upper bound on the Frobenius number whose encoding length is polynomial in the encoding length of .
In order to show -hardness we will prove that . Fix an instance for with vertex sets . We may assume that , is a matching and is non-empty since outwise it is trivial to decide if . We write for and . For a vertex with , we define an index . The -index simply maps the vertices in bijectively to . Suppose are the edges in the matching. We give the edge the index . That means the function maps the edges in bijectively to the positions .
Now we are ready to define the Frobenius instance. We will represent numbers using the base .
We may assume that and so and the encoding length of all numbers in are at most polynomial in . To understand the construction it will be useful to consider the -ary representation in which each number has at most 5 non-zero digits while each has at most 4 non-zero digits, see also Figure 1. We will prove that . Writing out the definitions this means we prove
Claim I. “” in (2).
Proof of Claim I. We assume that the LHS of (2) holds. Fix an integer

Figure 1: -ary representation of number arising from edge (top) and (bottom). Here means any number in .
. We need to prove that is -representable. We observe that , attained by setting for a number arising from any edge in . It suffices to prove the claim for with since we can then add integral multiples of to cover all integers in . Hence we can write in its -ary representation as
We set . Then by assumption, there is a set so that is a perfect matching. In particular . For each edge we will choose a single number so that . The construction of the numbers is as follows:
- Case . We write the edge as . Then we set
- Case . Using the same notation as above, we make the same choice minus the middle term, i.e.
Since is a perfect matching, each digit (belonging to ) receives one designated contribution which matches . Positions with receive ; if then the position is not in the support of any number. Moreover we have selected exactly numbers and so the -th digit receives . No carry-over occurs. Hence indeed .
Claim II. “” in (2).
Proof of Claim II. For the converse, we assume that all integers are -representable. Fix any set ; we need to show that there is a set so that is a perfect matching. Consider the number
By assumption we can write
where . For every number we choose a witness denoted by which is used to generate the number. Since and we can infer that . We claim that when adding up over in base , no carry-over occurs. To see this, consider the restriction to the digits in (which are the lower order digits). Each number contributes at most to at most 3 digits in while . At the same time, from (3) we know that each of the digits receives a contribution of . This may add up, but it leaves no room for slack. In particular we necessarily have and no carry-over can occur because then the contribution of digit to digit would inflate by a factor of . By the same “no slack” argument we know that for all and we also know that for distinct one has . We define the edge set . From the discussion above we already know that is a perfect matching. Since every edge contributes at most one number to and , we know that no carry-over can occur in the indices belonging to either. In particular by (3) this implies that . Then satisfies the claim.
References
[AB09] Sanjeev Arora and Boaz Barak. Computational Complexity - A Modern Approach. Cambridge University Press, 2009. URL: http://www.cambridge.org/catalogue/catalogue.asp?isbn=9780521424264.
[BHNW05] Dale Beihoffer, Jemimah Hendry, Albert Nijenhuis, and Stan Wagon. Faster algorithms for frobenius numbers. The Electronic Journal of Combinatorics, 12(1):R27, Jun. 2005. URL: https://www.combinatorics.org/ojs/index.php/eljc/article/view/v12i1r27, doi:10.37236/1924.
[Bra42] Alfred Brauer. On a problem of partitions. American Journal of Mathematics, 64(1):299–312, 1942. URL: http://www.jstor.org/stable/2371684.
[Kan89] Ravi Kannan. The frobenius problem. In C. E. Veni Madhavan, editor, Foundations of Software Technology and Theoretical Computer Science, Ninth Conference, Bangalore, India, December 19-21, 1989, Proceedings, volume 405 of Lecture Notes in Computer Science, pages 242–251. Springer, 1989. doi:10.1007/3-540-52048-1_47.
[Kan92] Ravi Kannan. Lattice translates of a polytope and the frobenius problem. Comb., 12(2):161–177, 1992. doi:10.1007/BF01204720.
[Mat16] Shunichi Matsubara. The computational complexity of the frobenius problem, 2016. URL: https://arxiv.org/abs/1602.05657, arXiv:1602.05657.
[McL84] A. McLoughlin. The complexity of computing the covering radius of a code. IEEE Transactions on Information Theory, 30(6):800–804, 1984. doi:10.1109/TIT.1984.1056978.
[RA96] Jorge L. Ramírez-Alfonsín. Complexity of the frobenius problem. Combinatorica, 16:143–147, 1996. URL: https://api.semanticscholar.org/CorpusID:118624008.