We originally wished to have a tail-piece for our previous note that would describe more precisely the relationship between the Möbius function and the distribution of prime numbers. However, since that would have needed a bit of a detour in order to be clearer to an unfamiliar reader, we decided to tell that story more expansively and separately. All that will be said here is elementary stuff that has been narrated many times by many other people. Nevertheless, given that this is a mathematical story everyone likes to tell, we are also telling it in the way it impressed itself on our own consciousness.

What is the distribution of prime numbers? This is a question many of us might have wondered about in school. The typical school teacher, which we had, showed little interest in answering it. The number of prime numbers less than or equal to a number is termed or the prime counting function. The 15 year old Carl Gauss spent his fallow time finding prime numbers in intervals of 1000s and thus built up an impressive list of them. From that he deduced an approximate expression for their distribution and wrote it down on his log tables:

Here the notation means that as the ratio of to , i.e., they are asymptotic. Later, his rival the French mathematician Legendre published a similar result:

But the Russian scientist Chebyshev showed that rather than 1.08366 the negative term would be correctly 1 as becomes large. Gauss subsequently improved his conjecture using the below function:

, where

His former student and professorial successor at Göttingen, Dirichlet, independently arrived at the same function, the logarithmic integral , as a possible expression for the asymptotic distribution of prime numbers, though he expressed it as a series. can be expressed as a series, which for large , can give as close approximations of it as needed depending on number of terms we use. Such a series is termed an asymptotic series for .

As a numerical example: . Using the first 4 terms of the above series we get a value of , which is a error. . Again using the first 4 terms of the series we get , which is a a error. One also notices that the first term of this series yields Gauss’s original cruder approximation. Figure 1 shows . The proofs of these conjectures were first obtained in the later 1800s after Riemann’s discovery of the complete function and came to be known as the famous prime number theorem.

Figure 1 in red, in blue and in green.

Now, this function was already discovered before Gauss by Leonhard Euler but its first extensive study is part of a story of the lives and times of men. When a supernova like Gauss shines in the firmament the light of other stars, even if bright, gets drowned. That indeed was the fate of his compatriot Johann von Soldner. Born about an year before Gauss, von Soldner was another of those self-taught geniuses who at an early age showed a talent both in mathematics and making instruments of his own. He went on to be scientist of note and a land surveyor (even as Gauss). Among other things, he was one of the first to predict the bending of light by gravity (of course Newton himself believed that gravity would act on light particles and bend their path but von Soldner made numerically precise predictions of what the value would be). He proposed an experiment of observing stars in the near the Sun in the sky to test this proposed bending (something later measured by the famous faked experiments of Arthur Eddington as part of testing Einstein’s prediction of the same from his theory of relativity). In 1809 CE, von Soldner using his great capacity for numerical calculations studied and provided a table of its values up to 7 decimal places. In the process he also calculated Euler’s constant that plays a key role in evaluating this integral to more than thirty places. He obtained a different value from the 19th place onwards for than that obtained by earlier by geometer Mascheroni during his study of Euler’s Gamma function. The difference caught the eye of Gauss given his interest in and his own computation recovered von Soldner’s value till the 22nd place. Gauss then called upon his 19 year old student, the astronomer Friedrich Nicolai, who was a mental calculating prodigy, to calculate Euler’s constant using a method based on Euler’s own sums. He did so to 40 decimal places showing von Soldner to be correct. As a result of von Soldner’s tables we got the first glimpse of how looks (Figure 2). Von Soldner also realized at one value of the value of while being apparently unaware of its importance in the matter of the prime number distribution.

Figure 2 with the Ramanujan-Soldner point

Unaware of most of the work done in the West over the past century, Srinivasa Ramanujan carried out his own studies to independently obtain expressions for the prime number distribution. In the process he discovered for himself that approximated the prime counting function. Ramanujan discovered multiple fast-converging series to evaluate . The simplest of which is:

, where is Euler’s constant.

In studying Ramanujan also independently discovered the approximate value of for which (Figure 2) and mentioned it in his exchange with Hardy. Thus, it is now known as the Ramanujan-Soldner constant: 1.45136….

To gain further appreciation of Ramanujan’s independent discovery of the use of in approximating we shall step back to the studies of Riemann in this regard. Riemann wondered if he could get a better approximation of the prime counting function than and arrived at the following expression:

Since we are keeping this note very basic we shall not expand on the additional terms , but the term is related to the zeros of the Riemann’s function in the complex plane. However, by using just the first listed term alone we get the fit shown in Figure 3.

Figure 3 in red, in blue, in green and is in black.

One notices right away that it is a better approximation in the range shown and on average is better than just . Ramanujan independently arrived at the same expression, short of the additional term dependent on the complex plane zeros of the Riemann function, and mentioned it to Hardy in course of their early exchange of letters. In his expression he captured that fact that does not count the prime numbers per say but the integer powers of primes weighted by . Thus, the first term corrects for the squares of primes; similarly in Ramanujan’s equivalent expression the term would correct for cubes of primes and so on.

From figure 1 and figure 2 we see that in the range we have plotted it. Indeed, the fact that the negative term results in a better fit to is in line with this. This led Gauss and Riemann to wonder if indeed was always greater than . It appears Ramanujan also initially might have thought the same and saw the negative terms as “bringing down” to . This indeed remains true for all that has been within our computational reach to date. However, remarkably, Littlewood produced a proof that and cross each other infinite number of times. This proof is rather difficult for those of meagre mathematical capacity, but it indicated that there should be some very large number where will, for the first time, become greater than . This can be intuitively understood in terms of the above expression for in terms of provided by Riemann. As noted above, beyond the terms that correct for the powers of primes (the biggest being ), there is the term based on the complex-plane zeros of the Riemann function. While normally that term reduces to something negligible, at some big number that term could neutralize the term and make bigger than . We have not reached that number through direct computation but Littlewood’s student Skewes came up with the first estimates of how big that number could be. Since then there has been a very active program in computational mathematics to size up that number. When I last checked it was established that the first crossing of and would happen somewhere near the gargantuan . This is truly an example of how computational intuition gained from even large numbers can eventually fail at some humongous number out of the reach our computation.

In addition to the above Riemann also discovered yet another prime counting function that he thought would be more or less the same as . This function combines the Möbius function , which we described in the previous note and :

Figure 4. Part 1: is in red, in black and in green; Part 2:

In Figure 4 we calculated as an approximation using the sum of the first 1000 terms in the above expression. This gives a value correct to the first place after the decimal point. This enough for our current purpose but is computationally costly as you need 1000 terms just to get this level of accuracy. As can be seen in Figure 4, closely approximates in the range we have plotted. Strikingly, Ramanujan entirely independently of Riemann arrived at the same function as in course of his studies on the prime number distribution before he began his exchange with Hardy.

As we saw, the original definition of takes a lot of terms to get even limited accuracy. In the late 1800s the Scandinavian mathematician J.P. Gram discovered a series that is equivalent to using the Riemann function:

Using the above series with just 99 terms we can compute to at least 5 places beyond the decimal point. Interestingly, Ramanujan arrived at yet another fast-converging series (we will call it after him) on his own to approximate , which gives values close to (Figure 5, top panel). Being the master of the Bernoulli numbers, which have an intimate connection with the Riemann function, Ramanujan used them instead of that function.

where are even Bernoulli numbers.

Ramanujan did not stop there and went on to produce a further approximation of as a definite integral, which we will denote as the Ramanujan integral :

where is the Gamma function.

This integral too gives values close to the series and as shown in Figure 5.

Figure 5. In the top panel the was calculated using the first 15 terms, which are sufficient to give convergence to 5 places after the decimal point. In the bottom panel was approximately calculated using the Gauss-Kronrod numerical integration method with the upper limit of the integral taken as 150 due to limitations in evaluation beyond that.

As we saw above (Figure 4) approximates better than in the range we have plotted it (the plot will be practically identical for the Ramanujan series and integral given that their values are close to : Figure 5). This indeed has been shown to be true computationally for even 10000 times bigger than our plotted range. Thus, it is not surprising that both Riemann and Ramanujan thought that , , are much better approximations of than or more or less itself. However, here again numerical intuition was shown to be imprecise. In a publication by Hardy and Littlewood, the latter remarkably proved that starting at some large number would become a better approximation of than these functions of Riemann, Gram and Ramanujan. Further, they would swap positions as the better approximation of an infinite number of times in the realm of giant numbers. Thus, one can only say that:

Ramanujan did all this work in isolation at Kumbhaghoṇa and Chennai before leaving for Cambridge. It must be remembered that he did have access to any serious cutting edge literature and his primary inspiration was evidently provided by Carr’s synopsis. Thus, after reading Carr, at age 17 Ramanujan independently discovered the famous Bernoulli numbers, which were originally discovered by Jakob Bernoulli (and perhaps by the Japanese Samurai Seki Takakazu or someone of his school) and were subject of much investigation in the west. Armed with this he went on to calculate Euler’s constant to 15 places after the decimal point, thus coursing on the path taken by Euler. This formed the platform for his foray into the distribution of prime numbers. While this has been routinely described as nonrigorous work starting from Hardy’s initial letters to Ramanujan, it does bring out his extraordinary intuition. To us this work established his connection to the past greats, even as Littlewood declared to Hardy that he was in the league of Euler or Jacobi (Or Bertrand Russell: “*I found Hardy and Littlewood in a state of wild excitement because they believe they have found a second Newton, a Hindu clerk in Madras making 20 pounds a year.*“). Indeed, it is rather striking how he single-handed covered some of the key ground spanned by the discoveries of Jakob Bernoulli, Euler, Gauss, Dirichlet and Riemann. He rediscovered many of their intuitions regarding the prime counting function. Not just that, he came up with his own with expressions, sometimes better the previously published ones, for the Bernoulli numbers, , and other asymptotic expressions for . Short of the Riemann function in the complex plane with its non-trivial zeros, Ramanujan penetrated key elements of the great prime number question all by himself. Thus, he was like one man all by himself trying to cover the “gap” in the mathematics of the Hindus following its decline from the high-point reached by the nambūtiri-s and their school. In many ways, while operating in modern mathematics, he seemed mysteriously “channel” the characteristics of the old Hindu greats, with their love for approximating functions and fast-converging series, which they delighted in since the age of the Yajurveda.

If Ramanujan represents the mastery of intuition, the other side, that certainty comes from rigor, is shown by the striking proofs of Littlewood regarding the and other approximations and . This was exemplified by Gauss, who, though unrivalled at intuition and experimentation, strove for rigor. He did not publish many of his works that contained key intuitions if he was unable to produce a proof for them as exemplified in his dense and rigor-filled Disquisitiones Arithmeticae. This aspect of mathematics, which is especially seen in higher arithmetic, is what sets mathematics apart from science. In science, barring those aspects which are truly reduced to a mathematical abstraction, we have nothing like a proof. Instead, a hypothesis is repeatedly tested for falsification. Thus, in scientific setting, things like , or as we saw in the previous article the Mertens function being inside the parabola, would have survived all attempts at falsification by direct experimentation (in this case computational). Yet, in mathematics they can be ultimately falsified even though they lie beyond the reach of direct experimentation.

Nevertheless, the fact that Ramanujan, far removed in space and time, was able to recapitulate and out do results of other great mathematicians before him suggests that mathematics is by no means an invention of the human mind. Rather, Ramanujan, like Euler, or Gauss or Riemann before him, were tapping into that Platonic realm where the mathematical ideals exist. The human intuition might grasp only “smudged” image of the ideal, yet because it exists even those images would be similar when apprehended independently by different explorers. Then the apparatus of rigor might get one closer to the ideal, but only after the intuition has apprehended it in the first place.