

#Prim numbers code
The complete project The Origin of the Prime Number Theorem ( pdf) is ready for student use and the \(LaTeX\) source code is available from the author by request. Using the letter written by Gauss, they then examine the error in their respective estimates. In the mini-PSP The Origin of the Prime Number Theorem, students explore how Legendre and Gauss may have arrived at their conjectures, compare the similar (though not identical) estimates for the number of primes up to \(x\) given by each, and examine some of the ideas related to different formulations of the Prime Number Theorem. Gauss claimed merely to have looked at the data and seen the pattern his complete statement reads "I soon recognized that behind all of its fluctuations, this frequency is on the average inversely proportional to the logarithm." Legendre gave even less indication of the origin of his estimate in particular, his rather precise constant of \(1.08366\) has, as far as I know, never been satisfactorily explained. Legendre then presented a table comparing the values predicted by his formula with the true count, as determined by a recently-published table of primes (Juri Vega's Thesaurus logarithmorum ). As early as 1792 or 1793, Gauss claimed, he had conjectured that the number of primes below a bound \(n\) was, in his notation, \(\int \frac \ldots.\]

He reported that he had been interested in primes when he was young, and that in fact he had both tabulated the number of primes in various intervals himself, and then spent some time studying a table of primes that had recently been compiled by John Lambert.

Late in his life (Christmas Day, 1849), Gauss wrote a letter to his colleague Johann Encke about prime numbers. The mini-Primary Source Project (PSP) The Origin of the Prime Number Theorem provides students with an introduction to this problem through the writing of Gauss and Legendre. Indeed, there's arguably no a priori reason to assume that there is a nice function that describes the density of primes at all. It would seem fairly clear to anyone who considered the matter that prime numbers are more rare among larger values than among smaller ones, but describing this difference mathematically seems not to have occurred to anyone earlier. Near the end of the eighteenth century, Adrien-Marie Legendre (1752–1833) and Carl Gauss (1777–1855) seemingly independently began a study of the primes–more specifically, of what we now call their density.
