HOW TO CHANGE COINS, M&M S, OR CHICKEN NUGGETS: THE LINEAR DIOPHANTINE PROBLEM OF FROBENIUS MATTHIAS BECK. Introduction Let s imgine tht we introduce new coin system. Insted of using pennies, nickels, dimes, nd qurters, let s sy we gree on using 4-cent, 7-cent, 9-cent, nd 34-cent coins. The reder might point out the following flw of this new system: certin mounts cnnot e exchnged, for exmple,,, or 5 cents. On the other hnd, this deficiency mkes our new coin system more interesting thn the old one, ecuse we cn sk the question: which mounts cn e chnged? In the next section, we will prove tht there re only finitely mny integer mounts tht cnnot e exchnged using our new coin system. A nturl question, first tckled y Ferdinnd Georg Froenius nd Jmes Joseph Sylvester in the 9 th century, is: wht is the lrgest mount tht cnnot e exchnged? As mthemticins, we like to keep questions s generl s possile, nd so we sk: given coins of denomintions,,..., d, which re positive integers without ny common fctor, cn you give formul for the lrgest mount tht cnnot e exchnged using the coins,,..., d? This prolem is known s the Froenius coin-exchnge prolem. One of the ppels of this fmous prolem is tht it cn e stted in every-dy lnguge nd in mny disguises, s the title of these notes suggests. To e precise, suppose we re given set of positive integers A = {,,..., d with gcd (,,..., d ) = nd we cll n integer k representle (in terms of A) if there exist nonnegtive integers m, m,..., m d such tht k = m + + m d d. In the lnguge of coins, this mens tht we cn exchnge the mount k using the coins,,..., d. The Froenius prolem (often clled the liner Diophntine prolem of Froenius) sks us to find the lrgest integer tht is not representle. We cll this lrgest integer the Froenius numer nd denote it y g(,..., d ). In the projects elow we will outline proof for the folklore result for d = : () g(, ) =. This simple-looking formul for g(, ) inspired gret del of reserch into formuls for the Froenius numer g (,,..., d ), with limited success: While it is sfe to ssume tht () hs een known for more thn century, no nlogous formul exists for d 3. The cse d = 3 is solved lgorithmiclly, i.e., there re efficient lgorithms to compute g(,, c) [7, 9, 0], nd in form of semi-explicit formul [8, 4]. The Froenius prolem for fixed d 4 hs een proved to e computtionlly fesile [, ], ut not even n efficient prcticl lgorithm for d = 4 is known. A second clssic theorem for the cse d =, which Sylvester posted s mth prolem in the Eductionl Times [8], concerns the numer of non-representle integers. Sylvester proved tht Dte: Octoer 007. These clss projects re prt of the Discrete Mth Resource Guide Project edited y Brin Hopkins.
MATTHIAS BECK exctly hlf of the integers etween nd ( )( ) re representle (in terms of nd ). In other words, there re exctly ( )( ) non-representle integers. We will lso outline proof of Sylvester s Theorem.. Notes to the instructor The first nine projects elow re suitle for ny course in which the students discussed gcd s nd the Eucliden Algorithm. The next set of prolems ssumes some sic numer theory, in prticulr, knowledge out the gretest-integer function nd inverses in Z n. The different projects nturlly vry in depth. Most prolems in the Eucliden lgorithm section re elementry; the slightly more complicted ones hve hint ttched to them. The prolems in the counting function section re it more dvnced ut should e dole in, e.g., n elementry numer theory clss. Finlly, the eyond d = section contins some open prolems, mny of which re suitle for computtionl explortion nd undergrdute reserch projects. The ide of the proofs hidden in the projects of the Eucliden lgorithm section ppered, to the est of my knowledge, first in []. Question nd the prolems in the counting function section ppered in [4]. For more, we refer to the reserch monogrph [5] on the Froenius prolem; it includes more thn 400 references to rticles written out the Froenius prolem. 3. The Eucliden Algorithm nd its consequences We pproch the Froenius prolem through the following importnt consequence of the Eucliden Algorithm. Theorem. Suppose nd re reltively prime positive integers. Then there exist m, n Z such tht = m + n. Wht we relly need is the fct tht one cn find such n integrl liner comintion of nd for ny integer: Corollry. Suppose nd re reltively prime positive integers. Given n integer k, there exist m, n Z such tht k = m + n. Students who just lerned out the Eucliden Algorithm might find the Froenius prolem musing, since this lst corollry lmost solves the Froenius prolem: in the ltter, we re only sking tht m, n Z re nonnegtive. It is this tiny dditionl condition tht mkes the Froenius prolem so hrd (nd interesting!). Let s put the Eucliden Algorithm to good use. Question. Suppose nd re reltively prime positive integers. Show tht given integer k cn e uniquely written s k = m + n, where m, n Z nd 0 m <. This gives simple ut useful criterion for k to e representle recll tht this mens tht k cn e written s nonnegtive integrl liner comintion of nd. Question. Suppose nd re reltively prime positive integers, nd write k Z s k = m+n where m, n Z with 0 m. Show tht k is representle (in terms of nd ) if nd only if n 0. This oservtion llows us to conclude, mong other things, tht the Froenius prolem is well defined:
THE LINEAR DIOPHANTINE PROBLEM OF FROBENIUS 3 Question 3. Suppose nd re reltively prime positive integers. Show tht every sufficiently lrge integer is representle (in terms of nd ). Question 4. Prove tht the generl Froenius prolem is well defined. Tht is, show tht, given reltively prime,,..., d, every sufficiently lrge integer is representle (in terms of,,..., d ). Question cn e tken step further to solve the Froenius prolem for d = : Question 5. Prove tht g(, ) =. Hint: Try to mximize possile non-representle integers, using Question. Question cn lso e used to prove Sylvester s Theorem. We strt with the following: Question 6. Suppose nd re reltively prime positive integers nd 0 < k < is not divisile y or. Prove tht k is representle (in terms of nd ) if nd only if k is not representle. Hint: Use Question for representle integer k. Think out how you cn strengthen the conditions of Question using the divisiility properties. Question 6 llows us to prove Sylvester s Theorem: Question 7. Prove tht there re ( )( ) non-representle integers. 4. A counting function Now we study the counting sequence () r k = # { (m, n) Z : m, n 0, m + n = k where nd re fixed reltively prime positive numers. In words, r k counts the representtions of k Z 0 s nonnegtive liner comintions of nd. Question 3 sttes tht this sequence hs only finitely mny r k s tht re 0, nd the Froenius prolem sks for the lrgest mong the r k s tht is 0. Question gives us the following lmost-periodicity identity for r k. Question 8. Suppose nd re reltively prime positive integers, nd let r k e given y (). Then r k+ = r k +. Remrk: There is no nlogous formul in the generl cse of d prmeters,,..., d. This is one reson why the Froenius prolem seems to e intrctle for d 3. Let s tke moment to look t geometric interprettion of r k. Fix, s usul, two reltively prime positive integers nd. Consider the line segment L k = { (x, y) R : x, y 0, x + y = k. The prmeter k cts like diltion fctor of the line segment L given y L = { (x, y) R : x, y 0, x + y =. Our counting sequence r k enumertes integer points in Z tht lie on the line segment L k. As k increses, the line segment gets dilted. It is not too fr fetched to expect tht the likelihood for n integer point to lie on the line segment L k increses with k. In fct, one might even guess tht this proility increses linerly with k, s the line segments re one-dimensionl ojects. Below we will give formul (Theorem 3) which shows tht this is indeed the cse. Figure shows the geometry ehind the counting function r k for the first few vlues of k in the cse = 4, = 7.
4 MATTHIAS BECK y 6 5 4 0 0 3 4 5 6 7 8 9 x Figure. 4x + 7y = k, k =,,... Note tht the thick line segment for the Froenius numer k = 7 = 4 7 4 7 is the lst one tht does not contin ny integer point. Similr geometric pictures cn e ssocited to the generl Froenius counting functions { # (m, m,..., m d ) Z d : ll m j 0, m + + m d d = k. Now the line segments get replced y tringles (d = 3), tetrhedr (d = 4), nd higher-dimensionl simplices, ut the generl picture, nmely tht these counting functions enumerte integer points in Z d in diltes of nice geometric ojects, stys the sme. This geometric interprettion gives glimpse into sufield of Discrete Geometry clled Ehrhrt theory. It concerns the study of integer-point enumertion in polytopes, of which line segments, tringles, tetrhedr, etc., re specil cses. The reder interested in these topics my consult the forthcoming ook [3]. There one cn find proof of the following eutiful formul for r k due to Tieriu Popoviciu, which we will use to re-derive some results on the Froenius prolem. First we need to define the gretest-integer function x, which denotes the gretest integer less thn or equl to x. A close siling to this function is the frctionl-prt function {x = x x. Theorem 3 (Popoviciu). If nd re reltively prime, the counting function is explicitly given y r k = # { (m, n) Z : m, n 0, m + n = k. r k = k { k where mod nd mod. { k +, Remrk: There re nlogous formuls for the generl Froenius counting functions { # (m, m,..., m d ) Z d : ll m j 0, m + + m d d = k, However, one should e creful with such sttement we invite the reder to prove tht if nd re not reltively prime, there re infinitely mny line segments L k tht do not contin ny integer point.
THE LINEAR DIOPHANTINE PROBLEM OF FROBENIUS 5 ut they re not s simple s in Popoviciu s Theorem, even if d = 3. These higher-dimensionl counting functions, nevertheless, give rise to generlized Dedekind sums, finite rithmetic sums tht pper in vrious other mthemticl contexts []. Question 9. Using Popoviciu s Theorem 3, give n lterntive proof of formul g(, ) = for the Froenius numer y proving tht r = 0 nd tht r k > 0 for every k >. Hint: Use the periodicity of {x nd the inequlity { m for integers m,. Question 0. Using Popoviciu s Theorem 3, give n lterntive proof tht r k + r k = for ny integer k tht is not divisile y or (cf. Question 6), nd use this to give nother proof of Sylvester s Theorem. Recll tht Question 6 llowed us to prove Sylvester s Theorem, so Question 0 gives n lternte proof of Sylvester s Theorem. Question. Given two reltively prime positive integers nd, we sy the integer k is j- representle if there re exctly j solutions (m, n) Z 0 to m + n = k. We define g j s the lrgest j-representle integer. (So g 0 is the Froenius numer.) Prove: () g j is well defined. () g j = (j + ). (c) Given j, the smllest j-representle integer is (j ). (d) There re exctly integers tht re uniquely representle. (e) Given j, there re exctly j-representle integers. 5. Beyond d = We end these notes with n outline of wht is known for the generl Froenius prolem. One such extension ws lredy mentioned in the lst project. For more, we refer to the reserch monogrph [5] on the Froenius prolem; it includes more thn 400 references to rticles written out the Froenius prolem. To give the stte of the rt for the cse d = 3 nd eyond, we define the generting function of ll representle integers, given some fixed prmeters,,..., d with no common fctor, s F (x) := k representle xk. One cn prove tht this generting function cn lwys e written s rtionl function of the form F (x) = x k p(x) = ( x ) ( x ). ( x d) k representle Furthermore, in the cse d = one cn show tht F (x) = x. Denhm [8] recently discovered the remrkle fct tht for d = 3, the polynomil p hs either 4 or 6 terms. He gve semiexplicit formuls for p, from which one cn deduce semi-explicit formul for the Froenius numer g(,, c). This formul ws independently found y Rmírez-Alfonsín [4]. As we lredy remrked in the introduction, there is no esy formul for d = 3 tht would prllel Theorem. However, Denhm s theorem implies tht the Froenius numer in the cse d = 3 is quickly computle, result tht is originlly due, in vrious guises, to Herzog [0], Greenerg [9], nd Dvison [7]. As much s there seems to e well-defined order etween the cses d = nd d = 3, there lso seems to e such order etween the cses d = 3 nd d = 4: Bresinsky [6] proved tht for d 4, there is no solute ound for the numer of terms in p, in shrp contrst to Denhm s theorem. On the other hnd, Brvinok nd Woods [] proved recently tht for fixed d, the rtionl generting function F cn e written s short sum of rtionl functions; in prticulr, F cn e
6 MATTHIAS BECK efficiently computed when d is fixed. A corollry of this fct is tht the Froenius numer cn e efficiently computed when d is fixed; this theorem is due to Knnn []. On the other hnd, Rmírez-Alfonsín [3] proved tht trying to efficiently compute the Froenius numer is hopeless if d is left s vrile. While these results settle the theoreticl complexity of the computtion of the Froenius numer, prcticl lgorithms re completely different mtter. Both Knnn s nd Brvinok-Woods ides seem complex enough tht noody hs yet tried to implement them. The fstest known lgorithm is due to Beihoffer, Nijenhuis, Hendry nd Wgon [5]; it is currently eing improved y Einstein, Lichtlu, nd Wgon. We conclude with few more projects. They differ distinctively from the ones we hve given so fr in tht they constitute open reserch prolems. I list them in wht I find the decresing order of difficulty (n estimte tht is nturlly sujective); the lter projects re most suitle for undergrdute reserch nd computtionl experiments tht should ring new insights. Question. Come up with new pproch or new lgorithm for the Froenius prolem in the d 3 cses. Question 3. There is very good lower [7] nd severl upper ounds [5, Chpter 3] for the Froenius numer. Come up with improved upper ounds. Question 4. Study vector generliztions of the Froenius prolem [6, 7], which seem for the most prt unexplored. Question 5. There re severl specil cses of A = {,,..., d for which the Froenius prolem is solved, for exmple, rithmetic sequences [5, Chpter 3]. Extend these specil cses nd come up with new ones. Question 6. Study the generlized Froenius numer g j (defined in Question ): Derive formuls for specil cses, e.g., rithmetic sequences. 6. Solutions Solution to Question. We mentioned lredy in Corollry tht ny integer k cn e written s k = m + n for some m, n Z. From this representtion we get others, for exmple, k = (m + ) + (n ) or k = (m ) + (n + ). In fct, ecuse nd re reltively prime, ll possile representtions of k s n integrl liner comintion of nd re given precisely y the expressions k = (m + j) + (n j), j Z. By choosing j ccordingly, we cn force the coefficient of to e in the intervl [0, ]. Solution to Question. If n 0, then k is representle y definition, since oth coefficients m nd n in k = m + n re nonnegtive. Conversely, suppose k is representle, sy k = j + l for some nonnegtive integers j nd l. If 0 j, we re done; otherwise, we sutrct enough multiples of from j such tht 0 m = j q. Then the coefficient l hs to e djusted to n = l + q, which is positive. Solution to Question 3. Question implies tht every integer k is representle, since when writing k = m + n with 0 m, n hs to e positive.
THE LINEAR DIOPHANTINE PROBLEM OF FROBENIUS 7 Solution to Question 4. Given n integer k, the Eucliden Algorithm sserts the existence of integers m, m,..., m d such tht k cn represented s k = m + m + + m d d. With the sme rgument s in the solution to Question, we cn demnd tht in this representtion 0 m, m 3,..., m d <, nd y extension of Question, k is representle if nd only if m 0. Hence certinly ll integers eyond ( + 3 + + d ) re representle in terms of,,..., d. Solution to Question 5. By Question, we hve to mximize the integrl coefficients m nd n in k = m + n, suject to 0 m nd n < 0 (so tht k is not representle). pprently k = ( ) + () =. Solution to Question 6. Suppose k is representle, so y Question we cn write k = m + n The mximl choice is for some nonnegtive integers m nd n with 0 m. Since k is not divisile y or, we hve m 0 nd n is not divisile y ; in prticulr, n is positive. But then k = m n = ( m) n, nd we note tht 0 < m < nd n > 0. This mens tht k cn e written in the form k = j + l with 0 j nd l < 0, nd y Question, k is not representle. Solution to Question 7. Question 6 implies tht, for k etween nd nd not divisile y or, exctly one of k nd k is representle. There re + = ( )( ) integers etween nd tht re not divisile y or. Finlly, if k is divisile y or then it is representle, simply y writing k s multiple of or. Hence the numer of nonrepresentle integers is ( )( ). Solution to Question 8. Question implies tht if k is representle then it cn e written s k = m + n for some nonnegtive integers m nd n with 0 m. representtion, nmely, k = (m + ) + (n ). If n then we get nother We cn continue the process of dding to the coefficient of nd sutrcting from the coefficient of, until the ltter ecomes negtive, nd those will e precisely the different representtions of k. Suppose j is the lrgest integer such tht n j 0. Tht is, k hs the j + representtions k = m + n = (m + ) + (n ) = (m + ) + (n ) = = (m + j) + (n j). Then k + hs the j + representtions k + = m + (n + ) = (m + ) + n = (m + ) + (n ) = = (m + (j + )) + (n j), precisely one representtions more thn k hs.
8 MATTHIAS BECK Solution to Question 9. We hve to show tht r = 0 nd tht r +n > 0 for ny positive n. To prove the first ssertion, we compute with Popoviciu s Theorem 3 r = { { ( ) ( ) + = { {. { Since = + j for some integer j, = { =. With essentilly the sme { rgument, we conclude tht =, which implies tht r = 0. To prove tht r +n > 0 for n > 0, we note tht for ny integer m, { m. Hence Popoviciu s Theorem 3 gives for ny positive integer n, r +n + n ( ) ( ) + = n > 0. Solution to Question 0. By Popoviciu s Theorem 3, r k = k { { ( k) ( k) + = k { { k k ( ) = k { { + k k + = r k. Here, ( ) follows from the fct tht {x = {x if x Z. Solution to Question. () Since every integer eyond hs t lest one representtion, every integer eyond (j + ) hs t lest j + representtions, y Question 8. () As we just showed, every integer eyond (j + ) hs t lest j + representtions. Furthermore, y the formul for g(, ) nd Question 8, (j + ) hs exctly j representtions, nd so g j = (j + ). (c) Let n e nonnegtive integer. Then { { ((j ) n) ((j ) n) r (j)n = (j ) n = j n { n { n. If n = 0, this equls j. If n is positive, we use the fct tht {x 0 to see tht r (k)n j n < j. + (d) In the intervl [, ], there re, y Sylvester s Theorem nd the fct tht is the smllest -representle integer, ( )( )
THE LINEAR DIOPHANTINE PROBLEM OF FROBENIUS 9 -representle integers. With Question 8 nd gin Sylvester s Theorem, we see tht there re ( )( ) -representle integers ove. Hence there is totl of uniquely representle integers. (e) It suffices to prove this result for j = ; then the generl sttement follows y induction with Question 8. By the previous proof nd Question 8, there re ()() integers with representtions in the intervl [ +,, nd ()() such integers eyond. Hence, together with the -representle integer, there re precisely integers with representtions. References. Alexnder Brvinok nd Kevin Woods, Short rtionl generting functions for lttice point prolems, J. Amer. Mth. Soc. 6 (003), no. 4, 957 979 (electronic), rxiv:mth.co/046.. Mtthis Beck, Ricrdo Diz, nd Sini Roins, The Froenius prolem, rtionl polytopes, nd Fourier-Dedekind sums, J. Numer Theory 96 (00), no.,, rxiv:mth.nt/004035. 3. Mtthis Beck nd Sini Roins, Computing the continuous discretely: Integer-point enumertion in polyhedr, Undergrdute Texts in Mthemtics, Springer-Verlg, New York, to pper 006. 4., A formul relted to the Froenius prolem in two dimensions, Numer theory (New York, 003), Springer, New York, 004, pp. 7 3, rxiv:mth.nt/004037. 5. Dle Beihoffer, Jemimh Hendry, Alert Nijenhuis, nd Stn Wgon, Fster lgorithms for Froenius numers, Electron. J. Comin. (005), no., Reserch Pper 7, 38 pp. (electronic). 6. Henrik Bresinsky, Symmetric semigroups of integers generted y 4 elements, Mnuscript Mth. 7 (975), no. 3, 05 9. 7. J. Leslie Dvison, On the liner Diophntine prolem of Froenius, J. Numer Theory 48 (994), no. 3, 353 363. 8. Grhm Denhm, Short generting functions for some semigroup lgers, Electron. J. Comin. 0 (003), Reserch Pper 36, 7 pp. (electronic). 9. Hrold Greenerg, An lgorithm for liner Diophntine eqution nd prolem of Froenius, Numer. Mth. 34 (980), no. 4, 349 35. 0. Jürgen Herzog, Genertors nd reltions of elin semigroups nd semigroup rings., Mnuscript Mth. 3 (970), 75 93.. Rvi Knnn, Lttice trnsltes of polytope nd the Froenius prolem, Comintoric (99), no., 6 77.. Alert Nijenhuis nd Herert S. Wilf, Representtions of integers y liner forms in nonnegtive integers., J. Numer Theory 4 (97), 98 06. 3. Jorge L. Rmírez-Alfonsín, Complexity of the Froenius prolem, Comintoric 6 (996), no., 43 47. 4., The Froenius numer vi Hilert series, preprint, 00. 5., The Diophntine Froenius prolem, Oxford University Press, 006. 6. Les Reid nd Leslie G. Roerts, Monomil surings in ritrry dimension, J. Alger 36 (00), no., 703 730. 7. R. Jmie Simpson nd Roert Tijdemn, Multi-dimensionl versions of theorem of Fine nd Wilf nd formul of Sylvester, Proc. Amer. Mth. Soc. 3 (003), no. 6, 66 67 (electronic). 8. Jmes J. Sylvester, Mthemticl questions with their solutions, Eductionl Times 4 (884), 7 78. Deprtment of Mthemtics, Sn Frncisco Stte University, Sn Frncisco, CA 943, USA E-mil ddress: eck@mth.sfsu.edu URL: http://mth.sfsu.edu/eck