Formulae for the number of partitions of n into at most m parts (using the quasi-polynomial ansatz)
aa r X i v : . [ m a t h . C O ] D ec Formulæ for the Number ofPartitions of n into at most m parts(Using the Quasi-Polynomial Ansatz) Andrew V. Sills a,1 , Doron Zeilberger b,2 a Department of Mathematical Sciences, Georgia Southern University, Statesboro, GA,30458-8093, USA b Department of Mathematics, Hill Center- Busch Campus, Rutgers University, 110Frelinghuysen Rd, Piscataway, NJ 08854-8019, USA
Abstract
The purpose of this short article is to announce, and briefly describe, aMaple package,
PARTITIONS , that (inter alia) completely automatically dis-covers, and then proves, explicit expressions (as sums of quasi-polynomials)for p m ( n ) for any desired m . We do this to demonstrate the power of “rigor-ous guessing” as facilitated by the quasi-polynomial ansatz. Keywords: integer partitions
1. Introduction
Recall that a partition of a non-negative integer n is a non-increasingsequence of positive integers λ . . . λ m that sum to n . For example the integer5 has the following seven partitions: { , , , , , , } . The bible on partitions is George Andrews’ magnum opus [1]. Email addresses:
[email protected] (Andrew V. Sills), [email protected] (Doron Zeilberger)
URL: http://math.georgiasouthern.edu/~asills (Andrew V. Sills), (Doron Zeilberger) A. V. S. thanks DIMACS for hospitality during his July 2011 stay, in which thisresearch with D. Z. was initiated. D. Z. is partially supported by a grant from the NSF.
Preprint submitted to Elsevier December 14, 2011 e denote by p m ( n ) the number of partitions of n into at most m parts.By a classic theorem [1, p. 8, Thm. 1.4], p m ( n ) also equals the numberof partitions of n into parts that are at most m . There is an extensiveliterature concerning formulæ for p m ( n ), including contributions by Cay-ley, Sylvester, Glaisher, and Gupta. For additional references and historicalnotes, see George Andrews’ fascinating article [2, §
3] and Gupta’s
Tables [8,pp. i–xxxix]. For an exhaustive history through 1920, see Dickson [4, Ch.3]. More recently, George Andrews’ student, Augustine O. Munagi, devel-oped a beautiful theory of so-called q -partial fractions [11], where the de-nominators in the decomposition are always expressions of the form (1 − q r ) s ,rather than powers of cyclotomic polynomials as is the case with the ordi-nary partial fraction decomposition. Accordingly, formulæ for p m ( n ) derivedfrom the q -partial fraction decomposition of the generating function are mostnaturally expressed in terms of binomial coefficients.It is well-known and easy to see that for any m , p m ( n ) is a sum of quasi-polynomials of periods , , , . . . , m . A quasi-polynomial of period r is a func-tion f ( n ) on the integers such that there exist r polynomials P ( n ) , P ( n ) , . . . , P r ( n )such that f ( n ) = P i ( n ) if n ≡ i (mod r ). We represent such a quasi-polynomial as a list [ P ( n ) , . . . , P r ( n )].Thus, e.g., we have, for n ≥ p ( n ) = 1 , (1) p ( n ) = (cid:20) n (cid:21) + (cid:20) − , (cid:21) , (2) p ( n ) = (cid:20) n
12 + n (cid:21) + (cid:20) − , (cid:21) + (cid:20) − , − , (cid:21) (3) p ( n ) = (cid:20) n
144 + 5 n
48 + 15 n
32 + 175288 (cid:21) + (cid:20) − n + 532 , n + 532 (cid:21) + (cid:20) , − , (cid:21) + (cid:20) , − , , (cid:21) (4) p ( n ) = (cid:20) n n
96 + 31288 n + 85192 n + 5065186400 (cid:21) + (cid:20) − n − , n
64 + 15128 (cid:21) + (cid:20) − , − , (cid:21) + (cid:20) , − , − , (cid:21) (cid:20) − , − , − , − , (cid:21) . (5)Eqs. (1)–(5) were given in 1856 by Cayley [3, p. 132] in a somewhatdifferent form. In 1909, Glaisher [6] presented formulæ for p m ( n ) for m =1 , , . . . ,
10. In 1958, Gupta [8] extended Glaisher’s results to the cases m =11 ,
12. In his 2005 Ph.D. thesis [10], Munagi gave formulæ for the cases m = 1 , , . . . ,
15. Munagi’s formulæ were derived with the aid of a Maplepackage he developed, and are of a somewhat different character than earliercontributions, as they follow from his theory of q -partial fractions [11].
2. The
PARTITIONS
Maple package
The purpose of this short article is to announce and briefly describe aMaple package,
PARTITIONS , that completely automatically discovers andproves explicit expressions (as sums of quasi-polynomials) for p m ( n ) for anydesired m . So far we only bothered to derive the formulæ for 1 ≤ m ≤ Not only that , we can, more generally, derive (and prove!), completelyautomatically, expressions, as sums of quasi-polynomials, for the number ofways of making change for n cents in a country whose coins have denomina-tions of any given set of positive integers. Not only that , we can derive (and prove!), completely automatically,expressions (as sums of quasi-polynomials) for D k ( n ), the number of parti-tions of n whose Durfee square has size k , for any desired, (numeric) positiveinteger k . (Recall that the size of the Durfee square of a partition λ . . . ...λ m is the largest k such that λ k ≥ k .) Not only that , we (or rather our computers (and of course yours, if it hasMaple and is loaded with our package)) can derive asymptotic expressions ,to any desired order , for both p m ( n ) and D k ( n ). As far we we know theformula for D k ( n ) is brand-new, and the previous attempts for the asymptoticformula for p m ( n ) by humans G.J. Rieger [14] and E.M. Wright [16] (ofHardy-and-Wright fame) only went as far as O ( n − ) and O ( n − ) respectively.We go all the way to O ( n − )! (and of course can easily go far beyond). Not only that , we implement George Andrews’ ingenious way [2, sec. 3]to convert any quasi-polynomial to a polynomial expression where one is also3llowed to use the integer-part function ⌊ n ⌋ . This enabled our computers tofind Andrews-style expressions for p m ( n ) for 1 ≤ m ≤ Maple package
PARTITIONS . In order to use PARTITIONS, you must have
Maple
T M installed on yourcomputer. Then download the file: andsave it as
PARTITIONS . Then launch Maple, and at the prompt, enter: read PARTITIONS :and follow the on-line instructions. Let’s just highlight the most impor-tant procedures.
AS100(m,n) : shows the pre-computed first 100 terms of the asymptoticexpression, in n , of p m ( n ) for symbolic m . ASD80(k,n) : shows the pre-computed first 80 terms of the asymptoticexpression, in n , of D k ( n ) for symbolic k . BuildDBpmn(n,M) : inputs a symbol n and a positive integer M and out-puts a list of size M whose i -th entry is an expression for p i ( n ) as a sum of i quasi-polynomials DiscoverAS(m,n,k) : discovers the asymptotic expansion to order k of p m ( n ) (the number of partitions of n into at most m parts) for large n andfixed, but symbolic , m . DiscoverDAS(k,n,r) : discovers the asymptotic expansion to order r of D k ( n ) (the number of partitions of n whose Durfee square has size k ) forlarge n and fixed, but symbolic k . Durfee(k,n) : discovers (rigorously!) the quasi-polynomial expression, in n , for D k ( n ), for any desired positive integer k . It is extremely fast for small k , but of course gets slower as k gets larger. DurfeePC(k,n) : does the same thing (much faster, of course!) using thepre-computed expressions of
Durfee(k,n); for k ≤ EvalQPS(L,n,n0) : evaluates the sum of the quasi-polynomials in thevariable n given in the list L at n = n . HRR(n,T) : evaluates in floating point the sum of the first T terms of theHardy-Ramanujan-Rademacher formula for p ( n ), the number of unrestricted4artitions of n : p ( n ) = 1 π √ X k ≥ √ k X ≤ h HRRr(n,T,k) . pmn(m,n) : discovers (rigorously!) the quasi-polynomial expression, in n ,for p m ( n ), for any desired positive integer m . It is extremely fast for small m , but of course gets slower as m gets larger. pmnPC(m,n) : does the same thing (much faster, of course!) using thepre-computed expressions of pmn(m,n); for m ≤ pmnAndrews(m,n) : discovers (rigorously!) the Andrews-style expression,in n , for p m ( n ) for any desired positive integer m . Instead of using quasi-polynomials explicitly (that some humans find awkward), it uses the integer-part function ⌊ n ⌋ , denoted by trunc(n) in Maple. pn(n) : the number of partitions of n , p ( n ), using Euler’s recurrence. Itis useful for checking, since p n ( n ) = p ( n ). pnSeq(N) : the list of the first N values of p ( n ). The output of pnSeq(50000): can be gotten from wherethis list of 50000 terms is called pnTable . pSn(S,n,K) : the more general problem where the parts are drawn fromthe list S of positive integers. It outputs an explicit expression, as a sumof quasi-polynomials, for p S ( n ), the number of integer partitions of n whoseparts are drawn from the finite list of positive integers S . K is a guessingparameter, that should be made higher if the procedure returns FAIL . pmnNum(m,n0) : like pmn(m,n); but for both numeric m and n 0. Theoutput is a number. For m ≤ 70 it is extremely fast, since it uses the pre-computed values of p m ( n ) gotten from pmnPC(m,n); . For example to get thenumber of integer partitions of a googol (10 ) into at most 60 parts, youwould get, in 0 . 02 seconds, the 5783-digit integer, by simply typing pmnNum(60,10**100); .One of us (DZ) posed this is a 100-dollar challenge to the users of thevery useful Mathoverflow forum. This was taken-up, successfully, by user5 oro [5], whose computer did it correctly in about 2 hours, using PARI . User joro generously suggested that instead of sending him a check, DZ shoulddonate it in joro ’s honor, to a charity of DZ’s choice, and the latter decidedon the Wikipedia Foundation. Sample input and output can be gotten from the “front” of this arti-cle: . 3. Methodology: Rigorous Guessing The idea of deriving formulæ for p m ( n ) and p S ( n ) with the aid of thepartial fraction decomposition of the generating function dates back at leastto Cayley [3]. We ask Maple to convert the generating function X n ≥ p m ( n ) q n = 1(1 − q )(1 − q ) · · · (1 − q m )or in the case of p S ( n ), where S = { s , s , . . . , s j } , X n ≥ p S ( n ) q n = 1(1 − q s )(1 − q s ) · · · (1 − q s j )into partial fractions. Then for each piece, Maple finds the first few terms ofthe Maclaurin expansion, and then fits the data with an appropriate quasi-polynomial using undetermined coefficients. The output is the list of thesequasi-polynomials whose sum is the desired expression for p m ( n ) or p S ( n ).See the source-code for more details. Example. Consider the case m = 4. We have Maple calculate that X n ≥ p ( n ) q n = 1(1 − q )(1 − q )(1 − q )(1 − q )= 17 / − q + 59 / − q ) + 1 / − q ) + 1 / − q ) + 1 / 81 + q + 1 / q ) + (1 + q ) / 91 + q + q . (6)At this point we could, as Cayley did, expand each term as a series in q ,collect like terms, and then the coefficient of q n will be a formula for p ( n ),but why bother? From Sylvester [15] and Glaisher [7], we know that p ( n ) = X j =1 W j ( n ) , W j ( n ) is a quasi-polynomial [ P j ( n ) , P j ( n ) , . . . , P jj ( n )] of period j . Further, W j ( n ) is of degree ⌊ m − jj ⌋ , and arises from those terms of (6) withdenominator a power of the j -th cyclotomic polynomial. Instead, let us allowMaple to guess the correct quasi-polynomials: We know a priori that W ( n )is of the form [ a + a n + a n + a n ] and let Maple calculate the (beginningof the) Maclaurin series for the terms of (6) that contribute to W ( n ):17 / − q + 59 / − q ) + 1 / − q ) + 1 / − q ) = 175288 + 1916 q + 581288 q + 11336 q + O ( q ) . Thus, a a a a = / / / / , which immediately implies that W ( n ) = (cid:20) n + 548 n + 1532 n + 175288 (cid:21) . Similarly, for W ( n ), which must be of the form[ a + a n, a + a n ] , we find 1 / 81 + q + 1 / q ) = 532 − q + 732 q − q + O ( q ) , so that (cid:20) (cid:21) (cid:20) a a (cid:21) = (cid:20) / / (cid:21) and (cid:20) (cid:21) (cid:20) a a (cid:21) = (cid:20) − / − / (cid:21) , and thus W ( n ) = (cid:20) − − n , 532 + n (cid:21) . Analogous reasoning yields W ( n ) = (cid:2) , − , (cid:3) and W ( n ) = (cid:2) , − , , (cid:3) .7 . Conclusion The present approach uses very na¨ıve guessing to discover, and prove (rigorously!), formulas (or as Cayley and Sylvester would say, formulæ ) forthe number of partitions of the integer n into at most parts m parts for m ≤ 70, and of course, one can easily go far beyond. The core of the ideagoes back to Arthur Cayley, and is familiar to any second-semester calculusstudent: partial fractions! But dear Arthur could only go so far, so hisgood buddy, James Joseph Sylvester, designated a sophisticated theory of“waves” [15] that facilitated hand calculations, which were later dutifullycarried out by J. W. L. Glaisher in [7]. But, with modern computer algebrasystems (Maple in our case), one can go much further just using Cayley’soriginal ideas. Acknowledgment The authors thank Ken Ono for several helpful comments on an earlierversion of this manuscript. References [1] G. E. Andrews, The Theory of Partitions, Addison-Welsley, 1976.Reprinted by Cambridge University Press, 1984. First paperback edi-tion, 1998.[2] G. E. Andrews, Partitions: at the interface of q -series and modularforms, Ramanujan J. 7 (2003) 384-400.[3] A. Cayley, Researches on the partition of numbers, Phil. Trans. RoyalSoc. of London, 146 (1856) 127–140.[4] L. E. Dickson, History of the Theory of Numbers, vol. 2: Diophan-tine Analysis, Carnegie Institute, Washington, 1920. Reissued by AMSChelsea and Dover.[5] “ joro ”, answer to Doron Zeilberger’s 100-dollar challenge, http://mathoverflow.net/questions/71092/how-many-integer-partitions-of-a-googol-10100-into-at-most-60-parts [6] J. W. L. Glaiser, On the number of partitions of a number into a givennumber of parts, Quart. J. Pure Appl. Math. 40 (1909) 57–143.87] J. W. L. Glaisher, Formulæ for partitions into given elements, derivedfrom Sylvester’s theorem, Quart. J. Pure Appl. Math. 40 (1909) 275–348.[8] H. Gupta, Tables of Partitions, Royal Society Mathematical Tables, vol.4, Cambridge University Press, 1958.[9] G. H. Hardy and S. Ramanujan, Asymptotic formulæ in combinatoryanalysis, Proc. London Math. Soc. (2) 17 (1918), 75–115.[10] A. O. Munagi, Restricted Partition Formulas, q -Partial Fractions, andthe Rademacher Conjecture, Ph.D. thesis, University of Lagos, Nigeria,2005.[11] A. O. Munagi, Computation of q -partial fractions, INTEGERS 7 (2007) p ( n ), Proc. London Math.Soc. (2) 43 (1938) 241–254.[13] H. Rademacher, On the expansion of the partition function in a series,Ann. Math. (2) 44 (1943) 416–422.[14] G. J. Rieger, ¨Uber Partitionen, Math. Annalen 138 (1959), 356-362.[15] J. J. Sylvester, On subinvariants, i.e. semi-invariants to binary quan-tics of an unlimited order. With an excursus on rational fractions andpartitions, Quart. J. Math. (Oxford Series (2)) 2 (1882) 85–108.[16] E.M. Wright, Partitions into kk