Ramanujan's intuition: the goddess, the notebooks and Hardy

A port-trust clerk in Madras wrote to Cambridge in January 1913 with formulas a leading mathematician could not prove. Where did they come from: a goddess, dreams, or something cognitive science can name?

Passport photograph of Srinivasa Ramanujan, a young man in a jacket with a namam mark on his forehead
Photo: Unknown authorUnknown author, Public domain, via Wikimedia Commons

Ramanujan's intuition is usually explained with one story: that the goddess Namagiri of Namakkal gave him formulas in dreams. That account comes from his Indian friends Seshu Aiyar and Ramachandra Rao, and G. H. Hardy, who worked with him for five years, rejected it. The record points to something less mysterious and more impressive: a self-taught memory for the behaviour of numbers, built through relentless computation, which let him see results long before he could prove them, and sometimes see wrong ones.

Key takeaways
  • 16 January 1913: a Madras Port Trust clerk mailed Hardy nine pages of unproved results.
  • Namagiri: the dream-goddess account comes from his Indian friends; Hardy disputed it.
  • Two wrong formulas in that first letter, one on primes, show the intuition was powerful, not infallible.
  • About 700 pages of notebooks record results with almost no proofs, built by constant calculation.
  • Kahneman and Klein (2009): intuition is trustworthy only in a regular field with fast feedback.

On the Namagiri story, Hardy went further than doubt: he insisted Ramanujan was no mystic and said Ramanujan had told him all religions seemed more or less equally true. This post retells the story from the primary record: Hardy's own 1936 Harvard lecture on Ramanujan, published in 1940, the dated biography in the MacTutor archive, and Bruce Berndt's account of the notebooks.

Then it asks what the cognitive science of expertise says about the kind of intuition Ramanujan had.

Who was Ramanujan before Hardy?

Srinivasa Ramanujan was born on 22 December 1887 in Erode and grew up in Kumbakonam, where his father was a clerk for a cloth merchant. He entered the Town High School in January 1898.

At about 15 he borrowed G. S. Carr's Synopsis of Elementary Results in Pure Mathematics from the Government College library, a tutor's compilation of about 6,000 results with almost no proofs. Hardy later judged it a decent book with clear gaps: nothing on complex function theory and nothing on elliptic functions, which makes Ramanujan's later mastery of elliptic functions all the stranger.

The education that collapsed

His formal education collapsed because he would do nothing but mathematics. The sequence is short and brutal:

  • 1905: lost his scholarship at the Government College in Kumbakonam for neglecting other subjects;
  • 1906: failed the First Arts exam at Pachaiyappa's College in Madras;
  • 1911: published a paper on Bernoulli numbers in the Journal of the Indian Mathematical Society;
  • 1 March 1912: started work as a clerk at the Madras Port Trust.
The story

On 16 January 1913, Ramanujan, then a clerk at the Madras Port Trust, wrote to G. H. Hardy at Trinity College, Cambridge. He had already written to two other Cambridge mathematicians, E. W. Hobson and H. F. Baker; neither replied. Hardy received nine pages of mathematics from an unknown Indian with no degree, and his first suspicion was fraud.

He showed the pages to his colleague J. E. Littlewood and the two worked through the list together. Some formulas Hardy recognised, some he could prove with effort, and a set of continued fractions on the last page he could not touch at all. On 8 February 1913 he wrote back that he was exceedingly interested, and that it was essential to see proofs. Within fourteen months Ramanujan was on a ship to England.

MacTutor History of Mathematics: Srinivasa Aiyangar Ramanujan
Ramanujan, 1887 to 19201887Born in Erode, 22 Decc.1903Borrows Carr's Synopsis (about 6,000 results)1905-06Loses scholarship, fails First Arts exam1912Clerk, Madras Port Trust1913Letter to Hardy, 16 JanHardy replies 8 Feb asking for proofs1914Sails 17 Mar; Trinity College, Cambridge1918Fellow of the Royal Society, 2 May1920Dies in Kumbakonam, 26 Apr, aged 32
Seven years separate the letter from his death. Most of what he is known for was worked out before Cambridge, in notebooks kept in India.
DateEvent
22 Dec 1887Born in Erode; family moves to Kumbakonam about a year later
c. 1903Borrows Carr's Synopsis, aged about 15
1904–05Government College, Kumbakonam; scholarship lost
1911First paper, on Bernoulli numbers
1 Mar 1912Clerk, Madras Port Trust
Jan 1913Writes to G. H. Hardy; Hardy replies on 8 Feb 1913
17 Mar 1914Sails for England; at Trinity College, Cambridge, from 30 Apr
16 Mar 1916BA by research for "Highly composite numbers"
2 May 1918Fellow of the Royal Society; Trinity Fellow from 10 Oct 1918
27 Feb 1919Sails home, ill
26 Apr 1920Dies in Kumbakonam, aged 32
The Mahamaham temple tank in Kumbakonam, Tamil Nadu, with stone steps and small shrines around the water
The Mahamaham tank in Kumbakonam, the temple town where Ramanujan grew up, went to school and died in April 1920.Photo: Vinayaraj, CC BY-SA 4.0, via Wikimedia Commons

What did Hardy make of the 1913 letter?

Hardy sorted it like a referee and concluded the writer was a mathematician of the highest class. In his 1936 Harvard lecture he walked his audience through his reaction, group by group:

  • Formulas he recognised, one going back to Laplace and Jacobi;
  • Integrals he could prove himself, with more effort than he expected;
  • Series results hinting that Ramanujan had far more general theorems up his sleeve;
  • Continued fractions that, in Hardy's words, "defeated me completely".

He had never seen anything like the last group. His reasoning from there is famous: results like these had to be true because nobody could have the imagination to invent them, and the writer had to be honest, because great mathematicians are commoner than frauds of that skill.

The mistakes Hardy also found

The part usually left out is that Hardy also found mistakes. The last two formulas in the letter were wrong, he said, and one of them, on the distribution of primes, showed that even Ramanujan's imagination could lead him seriously astray in the analytic theory of numbers.

That detail is the key to understanding his intuition. It was powerful, not infallible.

Where does the goddess story come from?

It comes from Ramanujan's Indian friends, and Hardy disputed it. The two memoirs printed in Ramanujan's Collected Papers (1927) disagree flatly.

  • His friends' account: P. V. Seshu Aiyar and R. Ramachandra Rao wrote that he had a special veneration for the goddess of Namakkal, said she inspired formulas in his dreams, and would write results down on waking and check them quickly.
  • Hardy's account: his religion was a matter of observance, not conviction, and Ramanujan had once told him, to Hardy's surprise, that all religions seemed to him more or less equally true.
ClaimSourceHow solid
Namagiri of Namakkal gave him formulas in dreamsSeshu Aiyar and Ramachandra Rao, reporting what he saidSecond-hand report of his own account
He wrote results on waking and verified themSame memoirPlausible; not independently recorded
He was an observant Brahmin who kept caste rules in CambridgeHardy, from direct knowledgeStrong
He had no definite religious beliefsHardy, from conversationContested by his Indian friends
He had little idea of what a proof wasJ. E. Littlewood, quoted by HardyStrong for his early work
1729 was a "dull" taxi number he instantly recognisedHardy, as eyewitnessStrong; he knew the number from earlier work

A fair hearing for Hardy

Hardy's own position deserves a fair hearing and a fair critique. He wanted, he said, to be a rationalist about Ramanujan and warned his audience against treating him as a mystery of eastern wisdom. That was a reasonable guard against romance.

It was also an English rationalist confidently overruling the people who had known Ramanujan longest, about his inner life. Neither account can be verified now. What can be checked is the mathematics, and the mathematics shows a working method, not a revelation.

Neither account of his inner life can be checked now. The mathematics can, and it shows a working method, not a revelation.
Panorama of the Great Court of Trinity College, Cambridge, with its hall, fountain, clock tower, chapel and gate
Great Court, Trinity College, Cambridge. Ramanujan moved into rooms at Trinity on 30 April 1914 and was elected a Fellow on 10 October 1918.Photo: Cmglee, CC BY-SA 3.0, via Wikimedia Commons

What do Ramanujan's notebooks show about his method?

They show a mind that computed constantly and recorded results tersely, almost always without proof. When he died he left three notebooks, a "lost notebook" of about 100 loose pages from his last year in India, and other manuscripts. Berndt, who spent decades proving their contents, gives the sizes.

Pages in Ramanujan's notebooks
See the data as a table
Organised chapters (pages)Loose or miscellaneous pages (pages)
First notebook13480
Second notebook252100
Third notebook330
Lost notebook0100

Source: Bruce C. Berndt, Ramanujan's Notebooks Part I (Springer, 1985), Introduction · First notebook: 16 chapters; second: 21 chapters, a revised and enlarged version of the first. Page counts for unorganised sections are approximate.

The second notebook is a revised, enlarged edition of the first, which matters: he went back over his results and reorganised them.

The long road to publication

  1. 1923: Hardy, who pushed for publication from the 1920s, spends three to four months of hard work on a single chapter.
  2. 1929: G. N. Watson and B. M. Wilson agree to edit the notebooks and expect it to take five years.
  3. 1935: Wilson dies at 38 and the work stalls.
  4. 1957: an unedited photostat edition appears.
  5. 1985 onward: Berndt's edited edition, which ran to five volumes.

Computation behind the "revelation"

Two details from the record cut against the pure revelation story. Hardy notes that on hard number-theoretic problems Ramanujan must have been guided a good deal by guesswork and intuition, and that Watson's reconstructions show a mixture of intuition and computation.

And the 1729 story itself, often told as instant magic, reflects work he had already done: the Science Museum's account, quoting the Nobel laureate Venki Ramakrishnan, notes that Ramanujan knew the number from his work on near-misses to Fermat's Last Theorem.

What is intuition in cognitive terms?

Psychology treats expert intuition as fast pattern recognition built from long exposure to a regular environment with feedback. In a 2009 paper, Daniel Kahneman and Gary Klein, from opposing research traditions, agreed on two conditions for trustworthy intuition:

  1. an environment regular enough to be predictable;
  2. enough opportunity to learn its regularities, through feedback.

They added that the feeling of certainty is not a reliable signal of accuracy.

When can intuition be trusted?After Kahneman and Klein (2009)Skilled intuitionSeries, continuedfractions, modularequations: checkableby calculationOverconfidenceRegular field, butfeedback misleads:prime counts lookright for a long rangeSlow learningRules exist, butfeedback is rareGut feeling onlyNo regularity, nofeedback: treat asa hypothesisFast, honest feedbackWeak or misleadingRegularfieldIrregularfieldPlacement of Ramanujan's topics is this post's reading of Hardy's account.
The same mind, two outcomes. Where every guess could be checked by calculation, Ramanujan was almost always right; on primes, where numbers mislead over a very long range, he was not.

Why the model fits Ramanujan

Ramanujan fits that model almost perfectly. Number theory and classical analysis are perfectly regular environments, and he gave himself feedback constantly by calculating. That explains both his strengths and his errors.

His formulas for series, continued fractions and modular equations, where calculation could check every guess, were extraordinarily right. His claims about prime distribution, where numerical evidence misleads for a very long range, included the kind of error Hardy pointed out. Subjective certainty, as Littlewood observed, made him look no further once evidence and intuition agreed.

What brain imaging adds

A 2016 study by Marie Amalric and Stanislas Dehaene scanned professional mathematicians and non-mathematicians of similar academic standing while they judged advanced mathematical statements. In mathematicians only, mathematical statements activated a consistent set of frontal, intraparietal and ventrolateral temporal regions, the same areas that respond to numbers and formulas in everyone, and spared the language areas.

Expert mathematical thought, in other words, seems to grow out of basic number sense rather than out of language. That fits a man who learned mathematics from a list of results and his own calculations, not from lectures.

None of this explains genius away. It describes the conditions under which genius of his kind can show up. The question of where mathematical truth lives, discovered or constructed, is the one Tagore and Einstein argued about in 1930; see the Tagore Einstein conversation. Ramanujan's habit of solitary, sustained work also connects with what research says about silence, solitude and thinking.

Why does Ramanujan's story still matter in India?

Because the system that nearly lost him is recognisable. He failed exams in subjects he did not care about, lost a scholarship, and found work as a clerk; his break came through a letter to a stranger abroad.

Today his birthday, 22 December, is National Mathematics Day, and his formulas still turn up in new physics: in December 2025, IISc researchers Faizan Bhat and Aninda Sinha reported in Physical Review Letters that the structure of his 1914 formulas for 1/π appears in logarithmic conformal field theories used in modern high-energy physics. Ramanujan sits alongside other Indian minds in the timeline of Indian thinkers on the mind.

Conditions for intuitive expertise: a failure to disagreeDaniel Kahneman and Gary Klein · American Psychologist · 2009

A joint paper by the leading critic of intuition (heuristics and biases) and a leading defender (naturalistic decision making). They map when professional intuition is skilled and when it is overconfident, and conclude that judging an intuition requires asking how predictable the environment is and whether the person had the chance to learn its regularities. Subjective confidence is not a reliable guide to accuracy. Limit: a conceptual synthesis of prior research, not a new experiment.

Read the paper
Origins of the brain networks for advanced mathematics in expert mathematiciansMarie Amalric and Stanislas Dehaene · PNAS · 2016

An fMRI study comparing professional mathematicians with non-mathematician academics of equal standing as they judged the truth of advanced statements in algebra, analysis, topology and geometry, and of non-mathematical statements. In mathematicians only, mathematical statements activated bilateral frontal, intraparietal and ventrolateral temporal regions that also respond to numbers and formulas in non-experts, while sparing language and general-semantics areas. Limit: a modest sample and a judgement task, which is not the same as discovery.

Read the paper (free)
Ramanujan: twelve lectures on subjects suggested by his life and workG. H. Hardy · Cambridge University Press · 1940 (lecture I given at Harvard, 1936)

The primary source for Hardy's reaction to the 1913 letter, his account of Ramanujan's religion and the goddess story (quoting Seshu Aiyar and Ramachandra Rao), the 1729 taxi, and Littlewood's remark on proof. Hardy is candid about Ramanujan's errors on primes and argues against mystifying him. Limit: written by his collaborator and champion, two decades after his death, with Hardy's own strong views on religion.

Read the book (free)

Questions people ask

Did a goddess really give Ramanujan his formulas?

That is what his friends Seshu Aiyar and Ramachandra Rao reported him saying, about the goddess of Namakkal and dreams. Hardy, who knew him in Cambridge, rejected it and said Ramanujan was no mystic. The notebooks show heavy computation behind the results.

How many results are in Ramanujan's notebooks?

Counts vary with how results are grouped, and I have not found one I could verify. What is certain is the size: the first notebook has 16 chapters over 134 pages plus about 80 more pages, the second 21 chapters over 252 pages plus about 100, the third 33 pages, and the lost notebook about 100 loose pages.

Was Ramanujan ever wrong?

Yes. Hardy pointed out that two formulas in the 1913 letter were wrong, including one on the distribution of primes, and said that in the analytic theory of numbers his imagination led him seriously astray. His record on series, continued fractions and modular equations was far stronger.

What is the 1729 story?

Hardy visited Ramanujan, ill in Putney, in taxi number 1729 and called it dull. Ramanujan replied that it is the smallest number expressible as a sum of two cubes in two different ways: 1³ + 12³ and 9³ + 10³.

Sources

  1. G. H. Hardy: Ramanujan, twelve lectures on subjects suggested by his life and work, Cambridge University Press (1940)
  2. MacTutor History of Mathematics: Srinivasa Aiyangar Ramanujan (source for the letters to Hobson, Baker and Hardy, and Hardy's 8 February reply)
  3. Wikipedia: Srinivasa Ramanujan (date of 16 January 1913 and the nine pages, citing Berndt and Rankin 2000 and Snow 1966)
  4. Bruce C. Berndt: Ramanujan's Notebooks, Part I, Introduction (Springer) (1985)
  5. Roger Highfield, Science Museum: Instinct, intuition and mathematics, the divine genius of Srinivasa Ramanujan (2018)
  6. Amir Aczel, Discover: A century on, this math prodigy's formulas are finally unravelled (2014)
  7. Kahneman D, Klein G: Conditions for intuitive expertise, American Psychologist (2009)
  8. Amalric M, Dehaene S: Origins of the brain networks for advanced mathematics in expert mathematicians, PNAS (2016)
  9. IISc: How Ramanujan's formulae for pi connect to modern high energy physics (2025)
Srinivasa RamanujanG. H. HardyNamagiriKumbakonamnotebooksintuitionexpertisemathematics
Sapta

Sapta (Saptarshi Sarkar) is a mechanical engineer turned marketer in Bengaluru and a solo touring rider. He writes the seven Saptaverse blogs. Work with him or read more of Mindblog.

Keep reading in Mindblog

From the other blogs