Abstract

This paper presents a new approach to determine the number of solutions of three-variable Frobenius-related problems and to find their solutions by using order reducing methods. Here, the order of a Frobenius-related problem means the number of variables appearing in the problem. We present two types of order reduction methods that can be applied to the problem of finding all nonnegative solutions of three-variable Frobenius-related problems. The first method is used to reduce the equation of order three from a three-variable Frobenius-related problem to be a system of equations with two fixed variables. The second method reduces the equation of order three into three equations of order two, for which an algorithm is designed with an interesting open problem on solutions left as a conjecture.

1. Introduction

Given positive integers with , we say is representable iffor some . The well-known linear Diophantine problem asks for the largest integer that is not representable. The linear Diophantine problems of Frobenius have many alternative names, such as the Frobenius coin problem, the postage stamp problem, and the chicken McNugget problem (cf. for example, Bardomero and Beck [1]).

Sylvester [2] showed that , that is, for any two relatively prime positive integers and , the greatest integer that cannot be written in the form for nonnegative integers is .

A consequence of the theorem is that there are exactly positive integers, which cannot be expressed in the form . The proof is based on the fact that, in each pair of the form , exactly one element is expressible.

There are many stories surrounding the origin of the Chicken McNugget theorem. However, the most popular by far remains that of the Chicken McNugget. Originally, McDonald’s sold its nuggets in packs of 9 and 20. Thus, to find the largest number of nuggets that could not have been bought with these packs creates the Chicken McNugget Theorem (the answer worked out to be 151 nuggets). More description on the history of McNugget problem can be found, for example, in [3, 4].

In Chapman and O’Neill [5], the McNugget number of order 3 is defined. We call a McNugget number associated with , if there exists an ordered triple of nonnegative integers such thatfor and , where . The paper [5] considers the case of , namely, the nonnegative solutions of

The nonnegative solutions of equation (3) give the partitions of into parts 6, 9, and 20. The number of those partitions is presented in the sequence A214772. It is worth noting that the coefficients of equation (3) are not pairwise relatively prime. In this paper, we consider the following related problems: (P1) for a given number , how many solutions, if exist, does equation (2) have? (P2) How to solve for all solutions with respect to given ?

Alfonsín [3], Hsu et al. [6], and Bardomero and Beck [1] presented a method to solve the problems similar to equation (3) by using the generating function. However, a large amount partial fraction steps are needed because the numbers 6, 9, and 20 are big. Chou et al. [7] gave a matrix method, which can be used to solve equation (3). However, this method needs to solve a complicated system of inequalities. In this paper, we present a simple approach to solve the above two problems, which can be extended to a general three-variable Frobenius-related problem. More materials on the linear Diophantine problem of Frobenius can be found in [811].

Denote the number of the solutions of equation (2) for a given by . Let be a set of relatively prime positive integers. Let denote the partition function of with parts in , that is, is the number of partitions of with parts belonging to . Thus, if , and are relatively prime positive integers, then . To find , where are relatively primes, we reduce it to with relatively prime and use the following formula to figure : for , where , with . Brown, Chou, and one of the authors [12] found the table as follows:where and are defined by with and with , respectively. Then, can be found accordingly.

In the next section, we use the table to give the number of solutions of equation (2). The process to derive the result also suggests an order reduction algorithm. In Section 3, we will present another order reduction algorithm based on the Bézout’s lemma. A conjecture about the solution structure is also given.

2. The Number of Solutions of Equation (2)

First, we establish the following result about the number of the solutions of equation (2).

Theorem 1. Let be the number of the solutions of equation (2), and let . Denote the set . Then,where satisfies .

Proof. If , then equation (2) can be written asIf , and are solutions of the above equation for a given , we need . If with , then we may find for and some such thatprovided that . Since , we have . Since , the number of the solution of equation (6) isand the number of solutions of equation (2) is given by equation (5).

Theorem 2. Let be the number of the solutions of equation (2), and let . Denote . Then,whereif , and otherwise, i.e., , , and are the smallest nonnegative integers satisfyingrespectively. Furthermore, the set of all nonnegative solutions of Diophantine equation (2) isfor all with , where is defined by equation (10) if ; otherwise, nonnegative solution set equation (12) does not exist.

Proof. We may use the formula shown in Binner (Corollary 17 in [13]) to find the number . Denote , , and . Thus, , and we need to be a nonnegative integer. In general, from [13], the number of nonnegative solutions of isif the second term on the right-hand side of equation (13) is nonnegative, where is the remainder when is divided by , is the remainder when is divided by , and and are the modular inverse of with respect to and with respect to , respectively, namely,It is obvious that the last two equations are equivalent toThus, and can be found by solving (cf. Remark 16 of [13])for and . From equation (16), we have equation (11) by noticing and . Denote if it is nonnegative. Substituting , , and into , we obtain equation (10). Then, from equation (13), we haveif , which implies equation (9).
Furthermore, from [13], the set of all nonnegative solutions of iswhen , which implies equation (12). If , then the set shown in equation (18) does not exist, which implies that in equation (9) must be zero. Hence, in this case, which completes the proof of the theorem.
We use the formula of the number of nonnegative solutions of given in [13] with modification for the case the nonnegative solution does not exist. Binner’s formula is equivalent to the one given by Tripathi [14]. In addition, the paper [15] gives the pretty much the same idea as that used in [13].
We may use Theorems 1 and2 to find . To use formula (5), we rewrite equation (3) asandSince 3 is a factor of the left-hand side of equation (19), we havewhich impliesThus, we need to consider three cases for , respectively, namely,respectively.
In the case of equation (23), by noticing and for , we haveThus, for , from Theorem 1, the number of the solutions of equation (19) isIn the case of equation (24), because , . By setting , we have the number of the solutions ofwhich isFinally, in the case of equation (25), because , . By setting , we obtain the number of the solutions ofwhich isWe now use formula (9) to count the solutions of problem equation (3). Since , to have for or , we need or , respectively. Thus,For and , we have and satisfyingFor and , we have and satisfyingFor and , we have and satisfyingHence, the number of solutions of equation (3) iswhere and satisfy equations (33)–(35).
The nonnegative solutions of problem equation (3) arefor all with , where is given in equation (32). More specifically, for , , and , we have , , and , respectively, and the correspondingfor ,for , andfor .
For instance, if , then is given by equation (38), where and satisfyingfor . Thus, and , andConsequently, the problem has solutions, which areIf , then is given by equation (40), where and satisfyingfor . Thus, and , andConsequently, the problem has solution, which isIf , then is given by equation (40), where and satisfyingfor . Thus, and , andConsequently, the problem has solutions, which areTo find all solutions of equation (2), we may use Theorem 2 to determine the number of solutions and use the following proposition to find each solution of equation (2).

Proposition 1. Let be a solution of . Then, all solutions of the equations are for all .

Example 1. Consider the equationand rewrite it asSince , we have the number of the solutions of the equationForm the formula for presented in the Introduction by noting , , and , we have with and satisfying . Thus, . While for , , and , we have with and satisfying . Thus, andThe nonnegative solutions of can be found from Proposition 1 and Euclidean algorithm as follows:The nonnegative solutions of areFor problems for which the Euclidean algorithm is inefficient, an alternate approach is presented below. Consider the equation to be with the given triple , for which is divisible by , we are seeking integer solutions .  Step 1:want a nonnegative integer solution for  Step 2:use modular arithmetic on the equation in Step 1:  Step 3:solve the above congruence using the smallest possible nonnegative value . Substituting the value of in the equation finds . If and , then and . Then, Step 4 can be skipped.  Step 4:if , then use Bezout’s Lemma to obtain the first nonnegative solution from with a positive integer such that and , where . If no such exists, then there are no nonnegative solutions to the problem. For example, does not have any nonnegative solutions.Illustration of the algorithm is as follows. ConsiderNote that the common divisor, d, of 3 and 5 is 1.Step 1: want nonnegative integer solution, , for .Step 2: implies and . Hence, and .Step 3: since and , we have .

Remark 1. We may also use the method presented in [13] to solve for obtaining the set of all nonnegative solutions . We set and to obtain and , respectively. Thus, , , and . Consequently, the nonnegative solutions of are , which are exactly the same as what we have obtained.

Remark 2. From the theory of partition (cf. [16]), the generating function of the sequence isFrom Taylor’s expansion, we haveFor smaller coefficients , and , we may find more efficiently. For instance, if , , and , then the solution number can be found by using the partial fraction technique shown below. Let . Then,for . Sinceand must be an integer, we obtain , where is referred to as the closest integer to . For instance, the solution number for is

3. Order Reduction Algorithm and Exhaustive Method for Solving Equation (2)

To find all solutions of equation (2), we may use following Bézout’s Lemma (cf. Millman et al. (Theorem 9 in [17])).

Lemma 1. The linear Diophantine equation has a solution if and only if is divisible by . Furthermore, if is any particular solution of this equation, then all other solutions are given bywhere is an arbitrary integer.

Let and be integers with the greatest common divisor . Then, from Bézout’s lemma, there exist integers and such that . More generally, the integers of the form are the multiples of . Expressions and shown in equation (64) are clearly true.

We are going to use Bézout’s lemma to solve a problem with two different features: (1) we are solving Diophantine equation (2) of order 3, and (2) we are seeking all nonnegative solutions.

Our algorithm is based on an order reducing technique. More precisely, let , and with , and let . A linear Diophantine equation of three variables is reduced to the following three Diophantine equations of two variables after setting , respectively. Graphically, the positive solutions of lie on the triangle intersecting by the plane and the first quadrant of the three-dimensional space . Let (with ), (with ), and (with ) be the three boundaries of the triangle . Then, along the boundaries, the equation is reduced to three two-variable equations. This paper discusses the relationship among the solutions on the boundaries , , and and the solutions on the triangle . This graphical description of our algorithm will be presented analytically and precisely below. More geometrical presentations of the problem can be found in Arnol’d [18] and Ustinov [19] and their references. Suppose one of , , and are divisors of . Bézout’s Lemma 1 shows that at least one of the Diophantine equationshas solutions. For instance, if , then one pair of nonnegative solutions of the first equation can be found easily by using an extended Euclidean algorithm easily. Particularly, if (or ), then it is easier to obtain a pair of solutions as (or ), and all pairs of solutions of the equation can be represented in the formwhere is an arbitrary integer. The set of all those solutions is denoted by , i.e.,

We are seeking nonnegative solutions of , i.e., a particular solution pair , where , and all solution pairs in equation (24) for such thatthat is, and .

In the above algorithm, we must assume one of the conditions, , , and , holds; otherwise, our algorithm fails because if does not divide , then clearly has no solutions since divides the left-hand side but not the right-hand side.

Consequently, if , and are pairwise coprime numbers, then can be solved by using our algorithm. As what we have defined before, the set of all solutions of the first equation in (65) is denoted by . Similarly, we let and denote the sets of the solutions of the second and the third equations of (65), respectively.

It is obvious that, for any integers , and , with and row vectors , , and 3, is also a solution of because

Because a solution obtained by using our order reducing method has at least one zero component, we can see how important it is to use these linear combinations complete the set of all solutions of equation (2), say to calculate the solutions with nonzero components. We will also demonstrate how to build those linear combinations by using some examples.

Proposition 2. Let sets , , be defined before, and let , and be any nonintegers, with . We have notationwhere , , and are solutions of , , and , respectively, and

Then, all nonnegative elements in the setare a solution of equation (2).

The proof is obvious from the above discussion and is, therefore, omitted.

To avoid using linear combinations, we may use the following exhaustive method. We assume , and let

Then, the solution set of equation (2) is .

Example 2. Consider the equationand reduce it to three Diophantine equations of order 2:for the cases of , , and in equation (74).
Equation (77) can be written as . Hence, yields a particular solution of equation (77) as and . The solution set isSimilarly, from equation (75), we havewhich shows equation (75) has no nonnegative integer solutions . Hence, the solution set of equation (75) isFinally, from equation (76), we haveTo have nonnegative solutions of equation (76), we must have or , which impliesHence, we have found 6 distinct solutions of equation (74). The 7th solution is from a linear combination of the elements , , and of the solution set with the coefficients , , and :Hence, the solutions of areIf we use the exhaustive method to check our results, then we obtainHence, the solutions of are as the same as equation (84).
However, sometimes, we have many solutions of that are not from the union . Therefore, we need calculate the number of the solutions and develop an efficient way (see below) to find the solutions in the form of , where and , . For instance, we may consider , and the corresponding solution sets of by using our algorithm are , , and , respectively. Hence,However, by using Theorem 1, we may find that the number of the solutions of iswhere , , and 2, are found by using Theorem 1.

Remark 3. For small and , the number of the solutions, denoted by , of the Diophantine equation can be also found by using the theory of partition, which is similar to the process of deriving equations (5) and (6). More precisely, from the theory of partition (cf. [16]), the generating function of the sequence isFrom Taylor’s expansion, we haveLet and be defined by equations (59), (60), (90), and (91), respectively. Then,Consequently, by using a straightforward exhaustive method for solving Diophantine equation (2), we haveFor smaller coefficients , and , we may find more efficiently. For instance, if and , then the solution number can be found by using the partial fraction technique shown below. Sincethe expansion of the power series can be written asConsequently,which gives , , , , and .
Sincewe need to find 10 more solutions by using the linear combination , where , , and .
The algorithm to establish those linear combinations is to find sets , say , etc. Denote . Then, we test all obtained solutions to find those distinct linear combinations (remember, ):such that because any solution of the form with one zero component has been obtained already.
As the simplest linear combination, we choose and calculatesuch that .
We now present the following conjecture for further discussion of finding all of nonnegative solutions of Diophantine equation (2).

3.1. Conjecture

For any solution of with , there exist solutions , , of either , , or such thatwhere , , in the last expression do not need to be different. Hence, if all three , , are the same, equation (100) presents itself.

We will illustrate that the conjecture is reasonable by using some examples. Meanwhile, we will give an algorithm to apply equation (100) to construct all of the solutions of the Diophantine equations in the examples.

We say the set is the smallest set of the collection , if the cardinal number . We say the set is the next smallest set of the collection , if the cardinal number . We say is the smallest element of a set , if is the smallest possible number in the set . Assume in equation (2). Then, in general, is the smallest set and is the next smallest set. One can also check that this is the case, in expressions (86), (87), and (88). Our algorithm can be described based on Proposition 2 as follows:Step 1. Determine the smallest element of the smallest setStep 2. Use the smallest element determined in the first step to subtract all of the elements in the next smallest set, , provided that the differences of the third components are positiveStep 3. Add the resulting elements obtained in the second step to all of the elements in , provided the resulting sums for all components are positiveStep 4. The union of the sets , , and those obtained in the third step consist of the whole solution set of equation (2)

As an example, we now use this algorithm to find the remaining part of the solution set of , besides those 14 solutions shown in equation (97). Based on our definition, is the smallest element of the smallest set in equation (86). We use to subtract all of those elements in the next smallest set, , in equation (87), such that the third components are positive, namely,

Following the algorithm, we add to , , and in equation (88) to obtain the following 5 solutions of :

By adding to , and in equation (88), we obtain the following 3 solutions of :

Adding to and in equation (88), we get the 2 more solutions of as

Adding to any element in equation (88), we cannot get an element with positive components, so we cannot get any more solutions. Thus, we obtain all 24 solutions of by combining the above 10 solutions and the 14 solutions shown in equation (97).

We use the exhaustive method to check our results and findwhere

Our algorithm is efficient for solving many Diophantine equations. However, the algorithm may not work for some Diophantine equation (2) although we think the expression in equation (100) can still be applied to find all of the solutions of equation (2), with some modification of the above algorithm. Here is an example. Consider the Diophantine equation:

For reducing equation , from and , we obtain and . Thus,which implies has nonnegative solutions . Similarly, for equation , the corresponding , , andwhich implies has nonnegative solution . For equation , the corresponding , , andwhich implies has solutions . Denote

Then, we pick up some three different elements from the five elements of the set to find other solutions of equation (107) by using equation (100). For instance,

By using Theorem 2, we may find equations have 2, 2, 2, 1, 1, 0, and 1 nonnegative solutions for , and 6, respectively. Hence, has 9 nonnegative solutions, and all of them can be presented by using equation (100). It worth mentioning that, for , has no nonnegative solution from Theorem 2 since .

Here, we have two comments. First, some three elements may not give a nonnegative solution of equation (107) by using equation (100), say . Secondly, it is clear that each element in can also be presented by using equation (100). Hence, we have the following consequence of the conjecture.

3.2. Consequence of the Conjecture

Denote and . Then, the number of solutions of equation (2) has bounds:which is implied by the conjecture if it is true.

Data Availability

The data used to support the findings of the study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.