Seeking Ramanujan - Intuition As Algorithm
Written by Mike James   
Sunday, 14 July 2019

This is an interesting story if you are into math and computing.  The Ramanujan Machine seeks inspired formulas for the fundamental constants. This potentially tells us something about the constants and, perhaps, the nature of computation.

Back when I was a physics student it was possible to get all mystical about the fact that the fine structure constant, a dimensionless number that controlled the nature of the universe, was 1/137. Put another way, the inverse of the fine structure constant was 137, an integer that no theory was able to predict. It seemed like magic and people tried to find something that made 137 special. Unfortunately the fine structure constant isn't exactly 137, but this still didn't stop people trying to find magic combinations of other constants that equaled it to its known accuracy. For example

π + π 2 + 4π 3

is 99.999% accurate. Impressive, but there are lots of similar formulas and they are all probably just chance. The search space is big and the accuracy isn't that high.

Now let us turn our attention to mathematics. Soon after learning about the fine structure constant, I encountered the story of Srinivasa Ramanujan, an untrained mathematician "discovered" in India and brought to Cambridge, England by the famous mathematician G.H. Hardy. If you think of mathematicians as working from proof to results, Ramanujan will be a shock for you. He did things differently by obtaining the result and then trying for the proof - often he left the proof to others.


Srinivasa Ramanujan (1887 - 1920).

A quote given in Wikipedia gives you some idea how he worked here is an account of a question set by Prasanta Chandra Mahalanobis :

Imagine that you are on a street with houses marked 1 through n. There is a house in between (x) such that the sum of the house numbers to the left of it equals the sum of the house numbers to its right. If n is between 50 and 500, what are n and x?' This is a bivariate problem with multiple solutions. Ramanujan thought about it and gave the answer with a twist: He gave a continued fraction. The unusual part was that it was the solution to the whole class of problems. Mahalanobis was astounded and asked how he did it. 'It is simple. The minute I heard the problem, I knew that the answer was a continued fraction. Which continued fraction, I asked myself. Then the answer came to my mind', Ramanujan replied.

Ramanujan was like an oracle for an NP problem. An oracle is an imagined entity that can provide a correct solution to a problem without saying how or why. In most cases we then focus on proving that the oracle's answer is correct. In this case Ramanujan would give you a solution and you could verify it usually quite quickly, but proving it, or working out how he got the solution, was hard.

In other words, Ramanujan was in part a conjecture machine. He pulled complex, but often elegant, formulas out of the air and this gave other mathematicians things to do and insights into their own field.

Now researchers are trying to replicate Ramanujan's style of math with the Ramanujan Machine. This is a program that seeks conjectures about the fundamental constants in the form of continued fractions. For example it has already found:


The expressions on the right are continued fractions and if you have never encountered them before you should be able to understand them from the way you would work them out as written. Continued fractions are interesting because they often make clear a regularity that would otherwise be missed.

The Ramanujan Machine looks for continued fraction expressions that have a regularity in the coefficients that are modeled by polynomials.  If the continued fraction is:


then the coefficients should be given by:

an=P1(n)  and  bn=P2(n)

where the Ps are polynomials. So, for example, if the first polynomial was n2 the continued fraction would have a set to 0, 1, 4, 9, and so on.

Polynomials give fairly simply patterns for the a and b, but only if they are low-order and simple themselves. The expression in the constants that the continued fractions were supposed to approximate were also simple polynomials. So we are seeking continued fractions to equal P3(c)/P4(c) where c is the constant.

The search method is fairly ingenious but, contrary to most readers expectations, no AIs were involved. This is a straightforward search using gradient decent and a heuristic to find solutions. You can read more about the methods in the paper.

So at the end of the day we have some conjectures. Surely the majority are going to be chance alignments of the digits? The paper says this:

"One may wonder whether the conjectures discovered by this work are indeed mathematical identities or merely mathematical coincidences that breakdown once enough digits are calculated. However, the method employed in this work makes it fairly unlikely for the conjectures to break down. For an enumeration space of 109 and result accuracy of more than 50 digits, the probability of finding a random match is smaller than 10−40. This minuscule probability makes us believe that the new conjectures are truths awaiting a rigorous proof by the mathematical community. In the past, the development of such proofs led to new discoveries, such as the consequences on number theory of the proof of Fermat’s last theorem. We believe and hope that proofs of these new conjectures will lead to new discoveries in the future."

Yes, it is a probabilistic argument and some of the results will turn out to be flukes, but most won't.

One result that has already been proved is that continued fractions with polynomials that have a ratio of degrees less than 2 converge at a super-exponential rate while those with a ratio greater than 2 converge at a polynomial rate. Another observation is that e seems to have more representations than other constants - why?

Another interesting area is the possibility of finding representations of constants that currently have no representations, such as Feigenbaum's constant from chaos theory. Such constants have to be evaluated numerically and an expression for them would be theoretically important.

Does any of this sound exciting?

If so:

"Inspired by worldwide collaborative efforts in mathematics such as the Great Internet Mersenne Prime Search (GIMPS) we launch the initiative dedicated for finding new RFs for fundamental constants. The general community can donate computational time to find RFs, propose mathematical proofs for conjectured RFs, or suggest new algorithms for finding them."

What are you waiting for?

PS: Check out the life of Srinivasa Ramanujan it is an inspiring  read.


More Information

Related Articles

Not 42 But 33 - The Sum Of Three Cubes

Google Smashes Pi Record For Pi Day

A New Mersenne Prime Discovery

A Mathematical Proof Takes 200 Terabytes To State

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.



Android 15 Developer Preview Updated

Google has released Android 15 Developer Preview 2 with changes including better handling of automatic language switching and updates for OpenJDK 17.

Excel Spreadsheet - A Joke?

No this isn't an April Fool's although in places it seems like one. It's a true account of how Williams Racing has suffered through reliance on an overgrown and outdated Microsoft Excel spreadsheet, l [ ... ]

More News

raspberry pi books



or email your comment to:


Last Updated ( Sunday, 14 July 2019 )