Coin problem

From Wikipedia, the free encyclopedia
  (Redirected from Frobenius problem)
Jump to navigation Jump to search
Two Pence 01.jpgFive New Pence.jpg

With only 2 pence and 5 pence coins, one cannot make 3 pence, but one can make any higher integral amount.

The coin problem (also referred to as the Frobenius coin problem or Frobenius problem, after the mathematician Ferdinand Frobenius) is a mathematical problem that asks for the largest monetary amount that cannot be obtained using only coins of specified denominations.[1] For example, the largest amount that cannot be obtained using only coins of 3 and 5 units is 7 units. The solution to this problem for a given set of coin denominations is called the Frobenius number of the set. The Frobenius number exists as long as the set of coin denominations has no common divisor greater than 1.

There is an explicit formula for the Frobenius number when there are only two different coin denominations, x and y : xyxy. If the number of coin denominations is three or more, no explicit formula is known; but, for any fixed number of coin denominations, there is an algorithm computing the Frobenius number in polynomial time (in the logarithms of the coin denominations forming an input).[2] No known algorithm is polynomial time in the number of coin denominations, and the general problem, where the number of coin denominations may be as large as desired, is NP-hard.[3][4]


In mathematical terms the problem can be stated:

Given positive integers a1, a2, …, an such that gcd(a1, a2, …, an) = 1, find the largest integer that cannot be expressed as an integer conical combination of these numbers, i.e., as a sum
k1a1 + k2a2 + ··· + knan,
where k1, k2, …, kn are non-negative integers.

This largest integer is called the Frobenius number of the set { a1, a2, …, an }, and is usually denoted by g(a1, a2, …, an).

The requirement that the greatest common divisor (GCD) equal 1 is necessary in order for the Frobenius number to exist. If the GCD were not 1, every integer that is not a multiple of the GCD would be inexpressible as a linear, let alone conical, combination of the set, and therefore there would not be a largest such number. For example, if you had two types of coins valued at 4 cents and 6 cents, the GCD would equal 2, and there would be no way to combine any number of such coins to produce a sum which was an odd number. On the other hand, whenever the GCD equals 1, the set of integers that cannot be expressed as a conical combination of { a1, a2, …, an } is bounded according to Schur's theorem, and therefore the Frobenius number exists.

Frobenius numbers for small n[edit]

A closed-form solution exists for the coin problem only where n = 1 or 2. No closed-form solution is known for n > 2.[4]

n = 1[edit]

If n = 1, then a1 = 1 so that all natural numbers can be formed. Hence no Frobenius number in one variable exists.

n = 2[edit]

If n = 2, the Frobenius number can be found from the formula . This formula was discovered by James Joseph Sylvester in 1882,[5] although the original source is sometimes incorrectly cited as,[6] in which the author put his theorem as a recreational problem[7] (and did not explicitly state the formula for the Frobenius number). Sylvester also demonstrated for this case that there are a total of non-representable integers.

Another form of the equation for is given by Skupień[8] in this proposition: If and then, for each , there is exactly one pair of nonnegative integers and such that and .

The formula is proved as follows. Suppose we wish to construct the number . Note that, since , all of the integers for are mutually distinct modulo . Hence there is a unique value of , say , and a nonnegative integer , such that : Indeed, because .

n = 3[edit]

Fast algorithms are known for three numbers (see Numerical semigroup for details of one such algorithm) though the calculations can be very tedious if done by hand. Furthermore, lower- and upper bounds for the n = 3 Frobenius numbers have been determined. The Frobenius-type lower bound due to Davison

is reported to be relatively sharp.[9]

The asymptotic average behaviour of for three variables is also known:[10]

where is the modified Frobenius number (greatest integer not representable by positive integer linear combinations of ).

Frobenius numbers for special sets[edit]

Arithmetic sequences[edit]

A simple formula exists for the Frobenius number of a set of integers in an arithmetic sequence.[11] Given integers a, d, s with gcd(ad) = 1:

The case above may be expressed as a special case of this formula.

Geometric sequences[edit]

There also exists a closed form solution for the Frobenius number of a set in a geometric sequence.[12] Given integers m, n, k with gcd(mn) = 1:

A simpler formula that also displays symmetry between the variables is as follows. Given positive integers , with let . Then [13]
where denotes the sum of all integers in


McNugget numbers[edit]

A box of 20 McDonald's Chicken McNuggets.

One special case of the coin problem is sometimes also referred to as the McNugget numbers. The McNuggets version of the coin problem was introduced by Henri Picciotto, who included it in his algebra textbook co-authored with Anita Wah.[14] Picciotto thought of the application in the 1980s while dining with his son at McDonald's, working the problem out on a napkin. A McNugget number is the total number of McDonald's Chicken McNuggets in any number of boxes. In the United Kingdom, the original boxes (prior to the introduction of the Happy Meal-sized nugget boxes) were of 6, 9, and 20 nuggets.

According to Schur's theorem, since 6, 9, and 20 are relatively prime, any sufficiently large integer can be expressed as a linear combination of these three. Therefore, there exists a largest non-McNugget number, and all integers larger than it are McNugget numbers. Namely, every positive integer is a McNugget number, with the finite number of exceptions:

1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 22, 23, 25, 28, 31, 34, 37, and 43 (sequence A065003 in the OEIS).
Total 0 1 2 3 4 5
+0  0:0,0,0  1: —  2: —  3: —  4: —  5: —
+6  6:1,0,0  7: —  8: —  9:0,1,0 10: — 11: —
+12 12:2,0,0 13: — 14: — 15:1,1,0 16: — 17: —
+18 18:3,0,0 19: — 20:0,0,1 21:2,1,0 22: — 23: —
+24 24:4,0,0 25: — 26:1,0,1 27:3,1,0 28: — 29:0,1,1
+30 30:5,0,0 31: — 32:2,0,1 33:4,1,0 34: — 35:1,1,1
+36 36:6,0,0 37: — 38:3,0,1 39:5,1,0 40:0,0,2 41:2,1,1
+42 42:7,0,0 43: — 44:4,0,1 45:6,1,0 46:1,0,2 47:3,1,1
+48 48:8,0,0 49:0,1,2 50:5,0,1 51:7,1,0 52:2,0,2 53:4,1,1
+54 54:9,0,0 55:1,1,2 56:6,0,1 57:8,1,0 58:3,0,2 59:5,1,1
A possible set of combinations of boxes for a total of 0 to 59 nuggets.
Each triplet denotes the number of boxes of 6, 9 and 20, respectively.

Thus the largest non-McNugget number is 43.[15] The fact that any integer larger than 43 is a McNugget number can be seen by considering the following integer partitions

Any larger integer can be obtained by adding some number of 6s to the appropriate partition above.

Alternatively, since and , the solution can also be obtained by applying a formula presented for earlier:[dubious ]

Furthermore, a straightforward check demonstrates that 43 McNuggets can indeed not be purchased, as:

  1. boxes of 6 and 9 alone cannot form 43 as these can only create multiples of 3 (with the exception of 3 itself);
  2. including a single box of 20 does not help, as the required remainder (23) is also not a multiple of 3; and
  3. more than one box of 20, complemented with boxes of size 6 or larger, obviously cannot lead to a total of 43 McNuggets.

Since the introduction of the 4-piece Happy Meal-sized nugget boxes, the largest non-McNugget number is 11. In countries where the 9-piece size is replaced with the 10-piece size, there is no largest non-McNugget number, as any odd number cannot be made.

Other examples[edit]

In rugby union, there are four types of scores: penalty goal (3 points), drop goal (3 points), try (5 points) and converted try (7 points). By combining these any points total is possible except 1, 2, or 4. In rugby sevens, although all four types of scores are permitted, attempts at penalty goals are rare and drop goals almost unknown. This means that team scores almost always consist of multiples of try (5 points) and converted try (7 points). The following scores (in addition to 1, 2, and 4) cannot be made from multiples of 5 and 7 and so are almost never seen in sevens: 3, 6, 8, 9, 11, 13, 16, 18 and 23. By way of example, none of these scores was recorded in any game in the 2014-15 Sevens World Series.

Similarly, in American football (NFL rules), any score is possible in a non-forfeit game except 1. The only ways to score 1 point are by a single point conversion after a 6-point touchdown, or to win by forfeit, where the score will be recorded as 1-0 or 0-1. As 2 points are awarded for a safety and 3 points for a field goal, all other scores apart from 1 are possible.

See also[edit]


  1. ^ J. Ramírez Alfonsín (2005). The Diophantine Frobenius problem. Oxford Univ. Press. 
  2. ^ Ravi Kannan (1992). "Lattice translates of a polytope and the Frobenius problem". Combinatorica. 12 (2): 161–177. doi:10.1007/BF01204720. 
  3. ^ D. Beihoffer; J. Hendry; A. Nijenhuis; S. Wagon (2005). "Faster algorithms for Frobenius numbers". Electronic Journal of Combinatorics. 12: R27. 
  4. ^ a b Weisstein, Eric W. "Coin Problem". MathWorld. 
  5. ^ Sylvester, James Joseph (1882). "On subinvariants, i.e. Semi-Invariants to Binary Quantics of an Unlimited Order". American Journal of Mathematics. 5: 134. JSTOR 2369536. 
  6. ^ Sylvester, James Joseph (1884). "Question 7382". Mathematical Questions from the Educational Times. 41: 21. 
  7. ^ J. Ramírez Alfonsín (2005). The Diophantine Frobenius problem. Oxford Univ. Press. p. xiii. 
  8. ^ Skupień, Zdzisław (1993). "A generalization of Sylvester's and Frobenius' problems" (PDF). Acta Arithmetica. LXV.4: 353–366. 
  9. ^ M. Beck; S. Zacks (2004). "Refined upper bounds for the linear Diophantine problem of Frobenius". Adv. Appl. Math. 32 (3): 454–467. arXiv:math/0305420Freely accessible. doi:10.1016/S0196-8858(03)00055-1. 
  10. ^ A. Ustinov (2009). "The solution of Arnold's problem on the weak asymptotics of Frobenius numbers with three arguments". Sbornik: Mathematics. 200 (4): 131–160. Bibcode:2009SbMat.200..597U. doi:10.1070/SM2009v200n04ABEH004011. 
  11. ^ Ramirez Alfonsin, Jorge (2005). The Diophantine Frobenius Problem. Oxford University Press. pp. 59–60. 
  12. ^ Ong, Darren C.; Ponomarenko, Vadim (2008). "The Frobenius Number of Geometric Sequences". INTEGERS: the Electronic Journal of Combinatorial Number Theory. 8 (1): A33. 
  13. ^ Tripathi, Amitabha (2008). "On the Frobenius Problem for Geometric Sequences, Article A43". Integers: the Electronic Journal of Combinatorial Number Theory. 8 (1). 
  14. ^ Wah, Anita; Picciotto, Henri (1994). "Lesson 5.8 Building-block Numbers". Algebra: Themes, Tools, Concepts (PDF). p. 186. 
  15. ^ Weisstein, Eric W. "McNugget Number". MathWorld. 

External links[edit]