In mathematical terms, the problem can be stated:
This largest integer is called the Frobenius number of the set { a 1 , a 2 , … , a n } {\displaystyle \{a_{1},a_{2},\dots ,a_{n}\}} , and is usually denoted by g ( a 1 , a 2 , … , a n ) {\displaystyle g(a_{1},a_{2},\dots ,a_{n})}
The existence of the Frobenius number depends on the condition that the greatest common divisor (GCD) is equal to 1. Indeed, the potential sums are multiples of the GCD in all cases. Hence, if it is not 1, then there are always arbitrarily large numbers that cannot be obtained as sums. For example, if you had two types of coins valued at 6 cents and 14 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; additionally, even numbers 2, 4, 8, 10, 16 and 22 (less than m=24) could not be formed, either. On the other hand, whenever the GCD equals 1, the set of integers that cannot be expressed as a conical combination of { a 1 , a 2 , … , a n } {\displaystyle \{a_{1},a_{2},\dots ,a_{n}\}} is bounded according to Schur's theorem, and therefore the Frobenius number exists.
A closed-form solution exists for the coin problem only where n = 1 or 2. No closed-form solution is known for n > 2.5
If n = 1 {\displaystyle n=1} , then we must have a 1 = 1 {\displaystyle a_{1}=1} so that all natural numbers can be formed.
If n = 2 {\displaystyle n=2} , the Frobenius number can be found from the formula g ( a 1 , a 2 ) = a 1 a 2 − a 1 − a 2 {\displaystyle g(a_{1},a_{2})=a_{1}a_{2}-a_{1}-a_{2}} , which was discovered by James Joseph Sylvester in 1882.67 Sylvester also demonstrated for this case that there are a total of N ( a 1 , a 2 ) = ( a 1 − 1 ) ( a 2 − 1 ) / 2 {\displaystyle N(a_{1},a_{2})=(a_{1}-1)(a_{2}-1)/2} non-representable (positive) integers.
Another form of the equation for g ( a 1 , a 2 ) {\displaystyle g(a_{1},a_{2})} is given by Skupień8 in this proposition: If a 1 , a 2 ∈ N {\displaystyle a_{1},a_{2}\in \mathbb {N} } and gcd ( a 1 , a 2 ) = 1 {\displaystyle \gcd(a_{1},a_{2})=1} then, for each n ≥ ( a 1 − 1 ) ( a 2 − 1 ) {\displaystyle n\geq (a_{1}-1)(a_{2}-1)} , there is exactly one pair of nonnegative integers ρ {\displaystyle \rho } and σ {\displaystyle \sigma } such that σ < a 1 {\displaystyle \sigma <a_{1}} and n = ρ a 1 + σ a 2 {\displaystyle n=\rho a_{1}+\sigma a_{2}} .
The formula is proved as follows. Suppose we wish to construct the number n ≥ ( a 1 − 1 ) ( a 2 − 1 ) {\displaystyle n\geq (a_{1}-1)(a_{2}-1)} . Since gcd ( a 1 , a 2 ) = 1 {\displaystyle \gcd(a_{1},a_{2})=1} , all of the integers n − j a 2 {\displaystyle n-ja_{2}} for j = 0 , 1 , … , a 1 − 1 {\displaystyle j=0,1,\ldots ,a_{1}-1} are mutually distinct modulo a 1 {\displaystyle a_{1}} . Thus any integer m {\displaystyle m} must be congruent modulo a 1 {\displaystyle a_{1}} to one of these residues; in particular, taking m = a 1 {\displaystyle m=a_{1}} there is a unique value of j = σ ≥ 0 {\displaystyle j=\sigma \geq 0} and a unique integer t {\displaystyle t} , such that a 1 = n − σ a 2 + t a 1 {\displaystyle a_{1}=n-\sigma a_{2}+ta_{1}} . Rearranging, we have a nonnegative integer ρ = 1 − t {\displaystyle \rho =1-t} so that n = ρ a 1 + σ a 2 {\displaystyle n=\rho a_{1}+\sigma a_{2}} . Indeed, ρ ≥ 0 {\displaystyle \rho \geq 0} because ρ a 1 = n − σ a 2 ≥ ( a 1 − 1 ) ( a 2 − 1 ) − ( a 1 − 1 ) a 2 = − a 1 + 1 > ( − 1 ) a 1 {\displaystyle \rho a_{1}=n-\sigma a_{2}\geq (a_{1}-1)(a_{2}-1)-(a_{1}-1)a_{2}=-a_{1}+1>(-1)a_{1}} .
To show that exactly half of the integers 0 , 1 , … , a b − a − b {\displaystyle 0,1,\ldots ,ab-a-b} are representable as non-negative integer linear combinations, one first shows that if the integer k ∈ [ 0 , a b − a − b ] {\displaystyle k\in [0,ab-a-b]} is representable, then N − k {\displaystyle N-k} is not representable, where N = a b − a − b {\displaystyle N=ab-a-b} .
One then shows that the converse is true as well: if k {\displaystyle k} is not representable, then N − k {\displaystyle N-k} is representable. To show this, use the fact that gcd ( a , b ) = 1 {\displaystyle \gcd(a,b)=1} , which allows us to write k = x a + y b {\displaystyle k=xa+yb} . Reducing and re-arranging the coefficients by adding multiples of a b {\displaystyle ab} as necessary, we can assume 0 ≤ x < b {\displaystyle 0\leq x<b} (in fact, this x {\displaystyle x} is the unique such x {\displaystyle x} satisfying the equation and inequalities).
Similarly we take u , v {\displaystyle u,v} satisfying N − k = u a + v b {\displaystyle N-k=ua+vb} and 0 ≤ u < b {\displaystyle 0\leq u<b} . Now we can add these equations to write N = ( u + x ) a + ( y + v ) b {\displaystyle N=(u+x)a+(y+v)b} which, using N = a b − a − b {\displaystyle N=ab-a-b} yields a b − b ( 1 + y + v ) = a ( x + u + 1 ) {\displaystyle ab-b(1+y+v)=a(x+u+1)} . The integer x + u + 1 {\displaystyle x+u+1} is positive, because x , u ≥ 0 {\displaystyle x,u\geq 0} . In fact, since the left-hand side of a b − b ( 1 + y + v ) = a ( x + u + 1 ) {\displaystyle ab-b(1+y+v)=a(x+u+1)} is divisible by b {\displaystyle b} , and ( a , b ) = 1 {\displaystyle (a,b)=1} , we must have that x + u + 1 {\displaystyle x+u+1} is divisible by b {\displaystyle b} . Yet x , u ≤ b − 1 {\displaystyle x,u\leq b-1} , so x + u + 1 ≤ 2 b − 1 {\displaystyle x+u+1\leq 2b-1} , so that x + u + 1 = b {\displaystyle x+u+1=b} . Substituting this into a b − b ( 1 + y + v ) = a ( x + u + 1 ) {\displaystyle ab-b(1+y+v)=a(x+u+1)} and subtracting a b {\displaystyle ab} from both sides yields b ( 1 + y + v ) = 0 {\displaystyle b(1+y+v)=0} . So 1 + y + v = 0 {\displaystyle 1+y+v=0} . This implies that y + v = − 1 {\displaystyle y+v=-1} , which means that exactly one of y {\displaystyle y} or v {\displaystyle v} is negative. If y {\displaystyle y} is negative, then v ≥ 0 {\displaystyle v\geq 0} , which means that N − k = u a + v b {\displaystyle N-k=ua+vb} is representable; the case when v {\displaystyle v} is negative entails that k {\displaystyle k} is representable.
Thus for any non-negative integer k ∈ [ 0 , a b − a − b ] {\displaystyle k\in [0,ab-a-b]} , we know that exactly one of k {\displaystyle k} or ( a b − a − b ) − k {\displaystyle (ab-a-b)-k} is representable (and these are distinct, because a b − a − b {\displaystyle ab-a-b} must be odd as the integers a , b {\displaystyle a,b} are relatively prime). This shows that half of the integers in the given range are representable; since there are ( a b − a − b + 1 ) = ( a − 1 ) ( b − 1 ) {\displaystyle (ab-a-b+1)=(a-1)(b-1)} integers in the range [ 0 , a b − a − b ] {\displaystyle [0,ab-a-b]} , this gives the desired result.
Formulae9 and fast algorithms10 are known for three numbers though the calculations can be very tedious if done by hand.
Simpler lower and upper bounds for Frobenius numbers for n = 3 have also been determined. The asymptotic lower bound due to Davison
is relatively sharp.11 ( f {\displaystyle f} here is the modified Frobenius number, which is the greatest integer not representable by positive integer linear combinations of a 1 , a 2 , a 3 {\displaystyle a_{1},a_{2},a_{3}} .)
The asymptotic average behaviour of f {\displaystyle f} for three variables is also known as:12
In 1978, Wilf conjectured that given coprime integers a 1 < a 2 < . . . < a d {\displaystyle a_{1}<a_{2}<...<a_{d}} , and their Frobenius number F {\displaystyle F} , we have
where g {\displaystyle g} denotes the number of all non-representable positive integers.13 In 2015, an asymptotic version of this was proven by Moscariello and Sammartano.14
A simple formula exists for the Frobenius number of a set of integers in an arithmetic sequence.15 Given integers a, d, w with gcd(a, d) = 1:
The n = 2 {\displaystyle n=2} case above may be expressed as a special case of this formula.
In the event that a > w 2 − 3 w + 1 {\displaystyle a>w^{2}-3w+1} , we can omit any subset of the elements a + 2 d , a + 3 d , . . . , a + ( w − 3 ) d , a + ( w − 2 ) d {\displaystyle a+2d,a+3d,...,a+(w-3)d,a+(w-2)d} from our arithmetic seq,e and the formula for the Frobenius number remains the same.16
There also exists a closed form solution for the Frobenius number of a set in a geometric sequence.17 Given integers m, n, k with gcd(m, n) = 1:
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 placed it as a puzzle in Games Magazine in 1987,19 and included it in his algebra textbook co-authored with Anita Wah.20 Picciotto thought of the application in the 1980s while dining with his son at McDonald's, working out the problem 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 (setwise) relatively prime, any sufficiently large integer can be expressed as a (non-negative, integer) 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:
Thus the largest non–McNugget number is 43.21 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. A straightforward check demonstrates that 43 McNuggets can indeed not be purchased, as:
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.
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 scoring are permitted, attempts at penalty goals are rare, and drop goals are almost unknown. This means that team scores almost always consist of multiples of tries(5 points) and converted tries (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, the only way for a team to score exactly one point is if a safety is awarded against the opposing team when they attempt to convert after a touchdown (which in this case has a value of 6). As 2 points are awarded for safeties from regular play, and 3 points are awarded for field goals, all scores other than 1–0, 1–1, 2–1, 3–1, 4–1, 5–1 and 7–1 are possible.
The Shellsort algorithm is a sorting algorithm whose time complexity is currently an open problem. The worst case complexity has an upper bound which can be given in terms of the Frobenius number of a given sequence of positive integers.
Petri nets are useful for modeling problems in distributed computing. For specific kinds of Petri nets, namely conservative weighted circuits, one would like to know what possible "states" or "markings" with a given weight are "live". The problem of determining the least live weight is equivalent to the Frobenius problem.
When a univariate polynomial is raised to some power, one may treat the exponents of the polynomial as a set of integers. The expanded polynomial will contain powers of x {\displaystyle x} greater than the Frobenius number for some exponent (when GCD=1), e.g., for ( 1 + x 6 + x 7 ) n {\displaystyle (1+x^{6}+x^{7})^{n}} the set is {6, 7} which has a Frobenius number of 29, so a term with x 29 {\displaystyle x^{29}} will never appear for any value of n {\displaystyle n} but some value of n {\displaystyle n} will give terms having any power of x {\displaystyle x} greater than 29. When the GCD of the exponents is not 1, then powers larger than some value will only appear if they are a multiple of the GCD, e.g. for ( 1 + x 9 + x 15 ) n {\displaystyle (1+x^{9}+x^{15})^{n}} , powers of 24, 27,... will appear for some value(s) of n {\displaystyle n} but never values larger than 24 that are not multiples of 3 (nor the smaller values, 1-8, 10-14, 16, 17, 19-23).
J. Ramírez Alfonsín (2005). The Diophantine Frobenius problem. Oxford Univ. Press. ↩
Ravi Kannan (1992). "Lattice translates of a polytope and the Frobenius problem". Combinatorica. 12 (2): 161–177. doi:10.1007/BF01204720. S2CID 19200821. /wiki/Doi_(identifier) ↩
D. Beihoffer; J. Hendry; A. Nijenhuis; S. Wagon (2005). "Faster algorithms for Frobenius numbers". Electronic Journal of Combinatorics. 12: R27. doi:10.37236/1924. http://www.combinatorics.org/Volume_12/Abstracts/v12i1r27.html ↩
Weisstein, Eric W. "Coin Problem". MathWorld. /wiki/Eric_W._Weisstein ↩
Sylvester, James Joseph (1882). "On subinvariants, i.e. Semi-Invariants to Binary Quantics of an Unlimited Order". American Journal of Mathematics. 5 (1): 134. doi:10.2307/2369536. JSTOR 2369536. /wiki/Doi_(identifier) ↩
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). ↩
Skupień, Zdzisław (1993). "A generalization of Sylvester's and Frobenius' problems" (PDF). Acta Arithmetica. LXV.4 (4): 353–366. doi:10.4064/aa-65-4-353-366. /wiki/Zdzis%C5%82aw_Skupie%C5%84 ↩
Tripathi, A. (2017). "Formulae for the Frobenius number in three variables". Journal of Number Theory. 170: 368–389. doi:10.1016/j.jnt.2016.05.027. https://doi.org/10.1016%2Fj.jnt.2016.05.027 ↩
See numerical semigroup for details of one such algorithm. /wiki/Numerical_semigroup ↩
M. Beck; S. Zacks (2004). "Refined upper bounds for the linear Diophantine problem of Frobenius". Adv. Appl. Math. 32 (3): 454–467. arXiv:math/0305420. doi:10.1016/S0196-8858(03)00055-1. S2CID 119174157. /wiki/ArXiv_(identifier) ↩
Ustinov, A. (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. /wiki/Bibcode_(identifier) ↩
Wilf, H.S. (1978). "A Circle-Of-Lights Algorithm for the "Money-Changing Problem"". The American Mathematical Monthly. 85 (7): 562–565. doi:10.2307/2320864. JSTOR 2320864. https://www.jstor.org/stable/2320864 ↩
Moscariello, A.; Sammartano, A. (2015). "On a Conjecture by Wilf About the Frobenius Number". Mathematische Zeitschrift. 280 (1–2): 47–53. arXiv:1408.5331. doi:10.1007/s00209-015-1412-0. /wiki/ArXiv_(identifier) ↩
Ramirez Alfonsin, Jorge (2005). The Diophantine Frobenius Problem. Oxford University Press. pp. 59–60. ↩
Lee, S.H.; O'neill, C.; Van Over, B. (2019). "On arithmetical numerical monoids with some generators omitted". Semigroup Forum. 98 (2): 315–326. arXiv:1712.06741. doi:10.1007/s00233-018-9952-3. S2CID 119143449. /wiki/ArXiv_(identifier) ↩
Ong, Darren C.; Ponomarenko, Vadim (2008). "The Frobenius Number of Geometric Sequences". INTEGERS: The Electronic Journal of Combinatorial Number Theory. 8 (1): A33. Retrieved 2010-01-04. http://www.emis.de/journals/INTEGERS/papers/i33/i33.Abstract.html ↩
Tripathi, Amitabha (2008). "On the Frobenius Problem for Geometric Sequences, Article A43". INTEGERS: The Electronic Journal of Combinatorial Number Theory. 8 (1). ↩
Picciotto, Henri (1987). "Math McPuzzle". Games Magazine. 85 (April/May): 52. https://archive.org/details/games-85-1987-april/page/n53/mode/2up ↩
Wah, Anita; Picciotto, Henri (1994). "Lesson 5.8 Building-block Numbers" (PDF). Algebra: Themes, Tools, Concepts. p. 186. http://www.mathedpage.org/attc/lessons/ch.05/5.08-building-blocks.pdf ↩
Weisstein, Eric W. "McNugget Number". MathWorld. /wiki/Eric_W._Weisstein ↩