Mathematics · Collaboration and a worked example

1916–1918

Ramanujan, Hardy and Integer Partitions: Counting and Approximation

Understand Ramanujan and Hardy’s partition problem with worked examples, independently checked exact counts, asymptotic estimates and a short exercise.

Historical portrait of Srinivasa Ramanujan, before 1920 according to the source record; an illustration of the mathematician, not a photograph of the partition calculation.
5
Partitions of four
42
Partitions of ten
1918
Journal publication year

The short answer

How many ways can an integer be written as an unordered sum? A question that is easy to try with four becomes formidable with one hundred. This guide introduces the problem behind a major Hardy–Ramanujan collaboration and compares exact counts with the leading approximation, without pretending that a numerical example is a proof.

Reproducible numerical illustration

Exact counts and the leading estimate

Exact values were independently calculated by two integer methods. Estimates use the displayed expression; rounded values are for reading, not the inputs to the error calculation.

Biography Compass calculations. This finite sample illustrates the leading term; it is not a proof of the asymptotic result.
nExact p(n)Leading A(n)Relative discrepancy
578.94+27.74%
104248.10+14.53%
20627692.38+10.43%
50204,226217,590.50+6.54%
100190,569,292199,280,893.35+4.57%

Chronology

A timeline of the turning points

  1. Preliminary communication

    The opening page records a preliminary communication on this date.

  2. Paper read

    The paper’s first page records the meeting date; it differs from the journal publication year.

  3. Journal publication

    Hardy and Ramanujan’s jointly authored paper appears in the Proceedings of the London Mathematical Society.

Start with four: order does not create a new partition

A partition of a positive integer is a way of expressing it as a sum of positive integers, with order ignored. Four has five partitions: 4; 3 + 1; 2 + 2; 2 + 1 + 1; and 1 + 1 + 1 + 1. Writing 1 + 3 instead of 3 + 1 does not add a sixth answer. Repeated parts, such as the two 2s, are allowed.

The notation p(n) records this count. Thus p(4) = 5. The opening of Hardy and Ramanujan’s paper defines the problem and relates it to a generating function. A generating function organizes the counts as coefficients of a power series; it is more than a list of numerical examples.

Sources for this section: [1]

Why a product can encode a counting problem

For a part of size k, the series 1 + x^k + x^(2k) + … represents choosing zero, one, two or more copies of that part. Multiplying these series for k = 1, 2, 3, … gives a coefficient of x^n for every choice of parts summing to n. This explains why the product 1 / ((1 − x)(1 − x²)(1 − x³)…) is connected to p(n).

This interpretation also gives a practical finite computation. For a target n, parts larger than n cannot occur, so a counting program only needs sizes 1 through n. We calculated the table below using integer arithmetic, then checked it with a separate generalized-pentagonal recurrence. These are newly computed examples for this guide, not values transcribed from the historical table.

Sources for this section: [1]

The leading asymptotic expression

For positive n, write A(n) = exp(π√(2n/3)) / (4n√3), where exp(t) means e raised to the power t. The leading Hardy–Ramanujan asymptotic relation says that p(n) / A(n) tends to 1 as n grows. It concerns relative behavior: it does not say the difference between the two numbers becomes zero, or that rounding A(n) always gives the exact count.

The scanned paper gives this expression on printed page 79, equation (1.41), and notes a misprint in an earlier communication. Its more detailed analysis goes beyond this single expression. The table deliberately compares only the leading term; it should not be presented as a test of the accuracy of every formula developed in the full paper.

Sources for this section: [1]

Read the numerical comparison correctly

For n = 10, the exact count is 42 and the leading expression gives approximately 48.10. Rounding that estimate does not recover 42. At n = 100, the relative discrepancy in this comparison is smaller, but the absolute difference is much larger. A declining relative error and a growing absolute error can occur together.

The listed percentage is (A(n) / p(n) − 1) × 100, rounded to two decimal places. All five estimates happen to exceed the exact counts. The sample alone does not prove that inequality for every n, nor can a finite table establish a limit. Its purpose is to help readers interpret an asymptotic statement accurately.

Sources for this section: [1]

A joint paper within Ramanujan’s wider career

The byline names G. H. Hardy and S. Ramanujan. Ramanujan’s mathematical publications began before his Cambridge years, and the Royal Society’s account identifies early Indian publications as well as later joint work. The partition paper is an important collaboration, not the whole of either mathematician’s career.

The source also distinguishes a preliminary communication, a meeting date and publication. The opening page gives December 1916 and January 1917; journal metadata identifies the published article as 1918, volume 17, pages 75–115. A timeline should label these events rather than treating every printed year as a competing discovery date.

Sources for this section: [1] · [2] · [3]

A short exercise, with an answer

Exercise: list every partition of five without counting reordered sums twice. Then use the table to explain why a better percentage approximation need not have a smaller absolute error.

Answer: 5; 4 + 1; 3 + 2; 3 + 1 + 1; 2 + 2 + 1; 2 + 1 + 1 + 1; and 1 + 1 + 1 + 1 + 1. There are seven. Comparing n = 10 with n = 100, the percentage discrepancy falls from about 14.53% to 4.57%, while the absolute discrepancy rises from about 6.10 to more than eight million. The exact count has grown enormously.

Sources for this section: [1]

Continue the chronology

Connected biographies

Read Ramanujan’s wider mathematical career

Historical seated portrait of Srinivasa Ramanujan, dated before 1920 by the Oberwolfach-derived source record.
IndiaCulture

1887–1920

Srinivasa Ramanujan

MathematicianSrinivasa Ramanujan was an Indian mathematician whose independent notebooks, published papers and Cambridge collaboration transformed several areas of number theory. His short career depended on both exceptional mathematical insight and a network that helped make sustained research possible.Read biography

Quick answers

Common questions

Are 3 + 1 and 1 + 3 different partitions?
No. Order is ignored when counting integer partitions.
Does the leading Hardy–Ramanujan approximation give exact counts?
Not in general. It describes asymptotic relative growth; rounding its value is not an exact counting algorithm.
How were the numbers here checked?
The exact counts were calculated using a generating-product dynamic program and checked against the generalized-pentagonal recurrence. The approximation and percentage differences were then calculated separately.

Primary and institutional sources

How this history was checked

Inspected the opening scanned pages of the jointly authored paper, including its definition, generating product, chronology and equation (1.41). Publisher metadata supports the 1918 bibliographic year. The numerical examples and exercise are original calculations, independently cross-checked; no complete proof reconstruction is claimed. The portrait has a separate public permission and provenance record. This article was reviewed on 27 October 2026.

  1. G. H. Hardy and S. Ramanujan / Proceedings of the London Mathematical SocietyAsymptotic Formulae in Combinatory Analysis: original scan hosted by IMSc
  2. London Mathematical Society / Wiley1918 publication record: volume 17, pages 75–115, DOI 10.1112/plms/s2-17.1.75
  3. Ellen Embleton / Royal SocietyRevisiting Ramanujan: earlier publications and Cambridge collaboration
  4. Oberwolfach Photo Collection / Wikimedia CommonsHistorical Ramanujan portrait: provenance, public-domain and VRT record