{
  "id": "integer-partition",
  "title": "Integer Partition",
  "lang": "en",
  "source_lang": "en",
  "summary": "An integer partition expresses a nonnegative integer as an unordered sum of positive integers, connecting counting problems with number theory, algebra, and asymptotic analysis.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Partition of an integer",
    "Additive partition",
    "Unrestricted partition"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/integer-partition/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/integer-partition/",
      "json": "https://aiwiki.page/zh/integer-partition.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "An integer partition of a nonnegative integer \\(n\\) is a way of writing \\(n\\) as a sum of positive integers, with the order of the summands disregarded. The summands are called parts. Integer partitions are fundamental objects in combinatorics and number theory, where they connect elementary counting problems with infinite products, congruences, and the representation theory of groups. The number of partitions of \\(n\\) is denoted by \\(p(n)\\), the partition function."
    },
    {
      "heading": "Definition and examples",
      "text": "A partition of \\(n>0\\) can be represented uniquely as a finite, weakly decreasing sequence\n\n\\[\\lambda=(\\lambda_1,\\lambda_2,\\ldots,\\lambda_\\ell), \\qquad \\lambda_1\\geq\\lambda_2\\geq\\cdots\\geq\\lambda_\\ell>0, \\qquad \\sum_{i=1}^{\\ell}\\lambda_i=n.\\]\n\nThe notation \\(\\lambda\\vdash n\\) means that \\(\\lambda\\) is a partition of \\(n\\). Its size is \\(|\\lambda|=n\\), and its length \\(\\ell(\\lambda)\\) is its number of parts.\n\nThe five partitions of \\(4\\) are\n\n\\[4,\\qquad 3+1,\\qquad 2+2,\\qquad 2+1+1,\\qquad 1+1+1+1.\\]\n\nThus \\(p(4)=5\\). The expressions \\(3+1\\) and \\(1+3\\) describe the same partition.\n\nThere is one partition of \\(0\\): the empty partition, containing no parts. Consequently, \\(p(0)=1\\). It is also convenient to define \\(p(n)=0\\) for negative integers \\(n\\). The first values are\n\n\\[p(0),p(1),\\ldots,p(10) = 1,1,2,3,5,7,11,15,22,30,42.\\]\n\nAn alternative representation records the multiplicity \\(m_j\\) of each part \\(j\\):\n\n\\[\\lambda=(1^{m_1}2^{m_2}3^{m_3}\\cdots), \\qquad \\sum_{j\\geq1}jm_j=n.\\]\n\nThe exponents here indicate repetition, not ordinary exponentiation.\n\nDistinction from related objects\n\nA composition of \\(n\\) is an ordered sum of positive integers. Thus \\(3+1\\) and \\(1+3\\) are different compositions but the same partition.\n\nA set partition divides a set of distinguishable elements into disjoint, nonempty blocks. The block sizes determine an integer partition, but generally many set partitions have the same block sizes. Integer partitions record sizes without retaining the identities of the elements."
    },
    {
      "heading": "Diagrams and conjugation",
      "text": "A partition can be visualized by arranging rows of dots or square boxes whose lengths are its parts. Dot representations are commonly called Ferrers diagrams, while box representations are called Young diagrams, although terminology varies.\n\nIn the convention with rows aligned on the left and the longest row at the top, the partition \\((4,2,1)\\) has diagram\n\n□□□□\n□□\n□\n\nTransposing the diagram exchanges rows and columns and gives the conjugate partition \\(\\lambda'\\). Its parts satisfy\n\n\\[\\lambda'_j=\\#\\{i:\\lambda_i\\geq j\\}.\\]\n\nFor example,\n\n\\[(4,2,1)'=(3,2,1,1).\\]\n\nConjugation is an involution: \\((\\lambda')'=\\lambda\\). It exchanges the largest part and the number of parts. As a result, the number of partitions of \\(n\\) into exactly \\(k\\) parts equals the number whose largest part is exactly \\(k\\). Likewise, partitions into at most \\(k\\) parts are equinumerous with partitions whose parts are all at most \\(k\\).\n\nA partition equal to its conjugate is self-conjugate. Such partitions correspond bijectively to partitions into distinct odd parts: the hook lengths of the diagonal boxes provide those odd parts."
    },
    {
      "heading": "Generating functions",
      "text": "The ordinary generating function for \\(p(n)\\) is Euler’s product:\n\n\\[\\sum_{n=0}^{\\infty}p(n)q^n = \\prod_{j=1}^{\\infty}\\frac{1}{1-q^j}.\\]\n\nFor each possible part size \\(j\\), the geometric series\n\n\\[\\frac{1}{1-q^j}=1+q^j+q^{2j}+\\cdots\\]\n\nrecords the choice of its multiplicity. Multiplying the factors records all choices of multiplicities, and the exponent of \\(q\\) records the resulting total.\n\nThe identity can be interpreted as a formal power series identity: computing the coefficient of \\(q^n\\) requires only the factors with \\(j\\leq n\\). It also holds analytically for complex \\(q\\) with \\(|q|<1\\).\n\nA second variable can track the number of parts:\n\n\\[\\prod_{j=1}^{\\infty}\\frac{1}{1-zq^j} = \\sum_{n,k\\geq0}p_k(n)z^kq^n,\\]\n\nwhere \\(p_k(n)\\) counts partitions of \\(n\\) into exactly \\(k\\) parts.\n\nRestricted partitions\n\nMany partition problems restrict the allowed sizes or multiplicities of parts. Their generating functions follow from the same principle:\n\n- Parts in a set \\(A\\) of positive integers:\n\n\\[\\prod_{a\\in A}\\frac{1}{1-q^a}.\\]\n- Distinct parts:\n\n\\[\\prod_{j\\geq1}(1+q^j).\\]\n- Odd parts:\n\n\\[\\prod_{j\\geq1}\\frac{1}{1-q^{2j-1}}.\\]\n- Parts at most \\(m\\):\n\n\\[\\prod_{j=1}^{m}\\frac{1}{1-q^j}.\\]\n\nThe generating function for exactly \\(k\\) positive parts is\n\n\\[\\sum_{n\\geq0}p_k(n)q^n = \\frac{q^k}{(1-q)(1-q^2)\\cdots(1-q^k)}.\\]\n\nSubtracting \\(1\\) from every part turns such a partition into one of \\(n-k\\) with at most \\(k\\) parts."
    },
    {
      "heading": "Partition identities",
      "text": "A partition identity states that two differently restricted classes of partitions have the same number of elements for every size. Such identities may be established through generating functions or by constructing an explicit bijection.\n\nEuler’s odd–distinct identity\n\nLeonhard Euler proved that the number of partitions of \\(n\\) into distinct parts equals the number into odd parts. The generating-function proof uses\n\n\\[\\prod_{j\\geq1}(1+q^j) = \\prod_{j\\geq1}\\frac{1-q^{2j}}{1-q^j} = \\prod_{j\\geq1}\\frac{1}{1-q^{2j-1}}.\\]\n\nA bijective proof repeatedly replaces two equal parts \\(a,a\\) by one part \\(2a\\). Starting from odd parts, this process produces distinct parts. The reverse operation splits every even part into equal halves until all parts are odd.\n\nRogers–Ramanujan identities\n\nA deeper example is the first Rogers–Ramanujan identity:\n\n\\[\\sum_{k=0}^{\\infty} \\frac{q^{k^2}}{(1-q)(1-q^2)\\cdots(1-q^k)} = \\prod_{j=0}^{\\infty} \\frac{1}{(1-q^{5j+1})(1-q^{5j+4})},\\]\n\nwith the denominator in the \\(k=0\\) term interpreted as \\(1\\).\n\nCombinatorially, it states that partitions whose successive parts differ by at least \\(2\\) are equinumerous with partitions whose parts are congruent to \\(1\\) or \\(4\\) modulo \\(5\\). Such results connect difference conditions on neighboring parts with arithmetic conditions on individual part sizes."
    },
    {
      "heading": "Recurrences and computation",
      "text": "Euler’s pentagonal number theorem states\n\n\\[\\prod_{j=1}^{\\infty}(1-q^j) = \\sum_{k=-\\infty}^{\\infty} (-1)^kq^{k(3k-1)/2}.\\]\n\nCombining this identity with the generating function for \\(p(n)\\) yields the recurrence\n\n\\[p(n)= \\sum_{k=1}^{\\infty}(-1)^{k-1} \\left[ p\\!\\left(n-\\frac{k(3k-1)}2\\right) + p\\!\\left(n-\\frac{k(3k+1)}2\\right) \\right].\\]\n\nOnly terms with nonnegative arguments contribute. Its beginning is\n\n\\[p(n)=p(n-1)+p(n-2)-p(n-5)-p(n-7) +p(n-12)+p(n-15)-\\cdots.\\]\n\nThe offsets \\(1,2,5,7,12,15,\\ldots\\) are generalized pentagonal numbers. Computing all values through \\(p(N)\\) by this recurrence requires \\(O(N^{3/2})\\) integer additions and subtractions and \\(O(N)\\) stored values, using big-O notation. This counts arithmetic operations rather than bit operations; the integers themselves grow with \\(N\\).\n\nA simpler dynamic-programming method begins with an array \\(a_0=1\\), \\(a_n=0\\) for \\(n>0\\). For each allowed part size \\(j\\), it updates\n\n\\[a_n\\leftarrow a_n+a_{n-j}\\]\n\nfor \\(n=j,j+1,\\ldots,N\\), in increasing order. Using every size from \\(1\\) through \\(N\\) computes unrestricted partition numbers in \\(O(N^2)\\) arithmetic operations. Restricting the processed sizes gives corresponding restricted partition counts.\n\nCounting partitions is much cheaper than explicitly listing them when \\(n\\) is large, because listing requires producing all \\(p(n)\\) objects."
    },
    {
      "heading": "Congruences and asymptotic growth",
      "text": "Ramanujan’s congruences\n\nSrinivasa Ramanujan discovered striking divisibility patterns:\n\n\\[\\begin{aligned} p(5n+4)&\\equiv0\\pmod5,\\\\ p(7n+5)&\\equiv0\\pmod7,\\\\ p(11n+6)&\\equiv0\\pmod{11}, \\end{aligned} \\qquad n\\geq0.\\]\n\nThese statements belong to modular arithmetic and arise within a broader theory relating partition generating functions to modular forms.\n\nThe Hardy–Ramanujan formula\n\nIn 1918, G. H. Hardy and Ramanujan obtained the asymptotic formula\n\n\\[p(n)\\sim \\frac{1}{4n\\sqrt3} \\exp\\!\\left(\\pi\\sqrt{\\frac{2n}{3}}\\right) \\qquad(n\\to\\infty).\\]\n\nHere \\(\\sim\\) means that the ratio of the two expressions tends to \\(1\\).\n\nThus \\(p(n)\\) grows faster than every fixed power of \\(n\\), but slower than \\(c^n\\) for every fixed \\(c>1\\). The leading expression is an approximation, not an exact formula for finite \\(n\\).\n\nTheir work helped establish the circle method, which extracts coefficients by analyzing generating functions near roots of unity. In 1937, Hans Rademacher obtained a convergent series giving \\(p(n)\\) exactly. Unlike a leading asymptotic approximation, sufficiently many terms of that series, combined with an error bound, can determine the exact integer value."
    },
    {
      "heading": "Algebraic and probabilistic connections",
      "text": "Symmetric groups and symmetric functions\n\nThe symmetric group \\(S_n\\) has conjugacy classes indexed by partitions of \\(n\\): the partition records the cycle lengths of a permutation. Its irreducible complex representations are also indexed by partitions of \\(n\\), making partitions central to representation theory.\n\nYoung diagrams support additional structures called Young tableaux. In a standard Young tableau of size \\(n\\), the boxes contain \\(1,\\ldots,n\\), increasing along each row and each column. The number of standard tableaux of shape \\(\\lambda\\) equals the dimension of the irreducible representation associated with \\(\\lambda\\).\n\nPartitions also index important bases of symmetric functions, including Schur functions, providing links among algebra, geometry, and combinatorial identities.\n\nRandom partitions\n\nA probability distribution on partitions turns their shapes and statistics into random objects. One model assigns equal probability \\(1/p(n)\\) to each partition of \\(n\\). Other models weight partitions using representation-theoretic quantities.\n\nThese choices give different typical behavior. Questions include the distribution of the largest part, the number of parts, and the limiting profile of a suitably rescaled diagram. A probability model must therefore be specified before statements about a “typical partition” have a definite meaning."
    }
  ],
  "links": [
    "integer",
    "combinatorics",
    "number-theory",
    "set-partition",
    "generating-function",
    "geometric-series",
    "power-series",
    "complex-number",
    "bijective-function",
    "leonhard-euler",
    "recurrence-relation",
    "big-o-notation",
    "modular-arithmetic",
    "symmetric-group",
    "representation-theory",
    "probability-distribution"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}