1. Home
  2. Explore
  3. Mathematics
  4. Prime Numbers Near a Trillion

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Prime Numbers Near a Trillion

Speaker 1Speaker 2

Prime Numbers Near a Trillion

12:40
0:00-12:40
  1. Simon

    Let’s begin with a numerical intuition question. Imagine the thousand integers from one trillion up to one trillion plus a thousand. What fraction would you guess are prime? Prime numbers get sparser as numbers get bigger, so it’s tempting to think there might be only one or four primes in that whole range.

  2. Michael

    A simple program can count them, though a naive approach takes time. To test a number for primality, you only need to try possible factors up to its square root. Around a trillion, that still means checking potential factors up to about a million, so doing that for every number in the range is a fair bit of work.

  3. Simon

    The count is 37 primes out of 1,000 numbers. So the proportion is 37 over 1,000, or 3.7 percent—about one prime in every 27 numbers. Of the rough choices in the quiz, one in 25 is closest; one in 250 or one in 1,000 is much too rare.

  4. Michael

    There’s a handy estimate that lets a mathematician predict that without checking all the numbers: near a large value x, the proportion of numbers that are prime is roughly one over the natural logarithm of x. At one trillion, the natural log is about 27.6, so the estimate is about one prime in every 28 numbers. That’s remarkably close to the observed one in 27.

  5. Simon

    And natural logarithm means logarithm base e. Saying the natural log of x is y is another way of saying e to the y equals x. For example, the natural log of 10 is about 2.3, because e raised to roughly 2.3 is 10. The connection between that logarithm and prime density is already a striking one.

  6. Michael

    There are even more surprising connections between primes, logarithms, and familiar constants. Start with the sum of the reciprocals of the squares: one over one squared, plus one over two squared, plus one over three squared, and so on. Euler proved that this infinite sum equals pi squared over six.

  7. Simon

    Now imagine filtering that sum in a peculiar way. Keep terms whose denominator is a prime, and also keep powers of primes, but for a prime raised to the kth power, divide its term by k. So the term for 4, which is 2 squared, is halved; the term for 8, which is 2 cubed, is divided by 3. Terms such as the one for 6 are discarded.

  8. Michael

    That sounds like an arbitrary mess, but the resulting sum equals the natural log of pi squared over six. The same kind of prime-and-prime-power filtering can be applied to the alternating sum one minus one third plus one fifth minus one seventh, which equals pi over four. In the example described here, the filtered series is related to the natural log of pi over four.

  9. Simon

    The important point is the astonishing pattern: a sum built from primes and their powers can produce a logarithm of an expression involving pi. It’s not just that primes are connected to a familiar constant; the natural logarithm appears in these relationships too.

  10. Michael

    Let’s look at two simpler series that make the role of natural logs easier to see. First, take one minus one half plus one third minus one fourth, and keep alternating signs. The terms get smaller, and the partial sums settle toward a value—specifically, the natural log of 2, about 0.69.

  11. Simon

    The other series has no alternating signs: one plus one half plus one third plus one fourth, and so on. Even though its terms shrink toward zero, the sum doesn’t settle at a finite value. It grows without bound, which can feel surprising when every new contribution is smaller than the last.

  12. Michael

    A beautiful way to prove that is to group terms in increasingly large blocks. Group one third and one fourth together; then group one fifth through one eighth; then one ninth through one sixteenth. In the first block, each term is at least one fourth, so the block contributes more than two times one fourth—more than a half.

  13. Simon

    In the next block, there are four terms, each at least one eighth, so together they contribute at least a half. The following block has eight terms, each at least one sixteenth, again giving at least a half. Every larger block can be bounded in the same way. So the whole sum contains one half again and again, and must keep growing.

  14. Michael

    That grouping also gives us a sense of how slowly it grows. The number of terms in each block doubles, so the number of blocks needed to reach a particular sum grows logarithmically. More precisely, the sum up to one over n is approximately the natural log of n, with a small constant correction.

  15. Simon

    That estimate answers an almost absurd question: how large does n have to be before the harmonic sum exceeds one million? We want the natural log of n to be about a million, which means n is about e to the millionth power. In powers of ten, that’s roughly 10 to the 434,000th—an unimaginably large number.

  16. Michael

    The conversion uses the fact that the natural log of 10 is about 2.3. So e to the million is 10 raised to about a million divided by 2.3, or roughly 434,000. The exact estimate can be refined, but even a rough calculation shows why the answer is so enormous.

  17. Simon

    To understand why natural logarithms keep showing up, we need to talk about the number e and exponential functions. You might see a family written as e to the r times t, where r changes the rate of growth. But any such family could also be written using different bases, like a to the t. The base is a choice of notation.

  18. Michael

    For example, 69 to the x is the same as e to the natural log of 69 times x. That follows because e to the natural log of 69 is 69, and the exponent rules let us rearrange the expression. We could even use pi as the base if we adjusted the exponent accordingly.

  19. Simon

    The same idea applies to familiar shapes like bell curves. A bell curve is often written with an exponential involving negative x squared, and changing what’s in the exponent changes the curve’s width. You could write an equivalent family using another base. The special usefulness of e isn’t that it alone can produce these shapes.

  20. Michael

    It’s also not quite right to say that e is uniquely the number that spins in the complex plane. The expression e to the i t moves around the unit circle, but so does 2 to the i t, or another positive base raised to i t. Changing the base changes the rate at which it moves.

  21. Simon

    What makes e so useful is its relationship to rates of change. The derivative of e to the t is e to the t itself. If an amount of money grows according to this function, its instantaneous growth rate equals its current amount. For e to the r t, the derivative is r times e to the r t, so r tells you the proportional growth rate.

  22. Michael

    That’s why writing an exponential as e to a rate times time can be so readable. If the function represents an investment, the coefficient r tells you how quickly the investment is growing relative to its current size. With another base, the same information is there, but it’s less directly visible.

  23. Simon

    We can see why other exponential bases have derivatives related to natural logs. Start with a to the x and compare its value at x plus a tiny step h with its value at x. The difference quotient is a to the x times the quantity a to the h minus 1, divided by h.

  24. Michael

    As h approaches zero, a to the x stays fixed, so the derivative is a to the x multiplied by the limit of a to the h minus 1 over h. That limit is the natural log of a. So the derivative of a to the x is the natural log of a times a to the x.

  25. Simon

    For base 2, that multiplying factor is the natural log of 2, about 0.69. You can see it numerically by taking a very small h and calculating two to the h minus one, then dividing by h. The result gets close to 0.693. For base e, the factor is one, which is exactly why e to the x is its own derivative.

  26. Michael

    There are several ways to introduce e. One is to define it as the base whose exponential has that especially simple derivative. Another is to define the exponential function through the infinite series one plus x plus x squared over two factorial, plus x cubed over three factorial, and so on.

  27. Simon

    That series has the remarkable property that its derivative is the very same series. The derivative of x squared over two factorial becomes x; the derivative of x cubed over three factorial becomes x squared over two factorial; and the pattern continues. Evaluating this function at one gives the number e.

  28. Michael

    Once we know the derivative of e to the y, we can find the derivative of its inverse, the natural logarithm. If y equals the natural log of x, then e to the y equals x. A small change in y produces a change in e to the y equal to e to the y times that small change, so the slope of the logarithm is one over e to the y.

  29. Simon

    But e to the y is x, so the derivative of the natural log of x is one over x. This makes sense from the graph: the slope gets smaller as x gets larger. And it gives us a direct calculus connection to the harmonic sum, whose terms are also reciprocals.

  30. Michael

    Consider the integral of one over x from 1 to n. Since the natural log has derivative one over x, that integral is the natural log of n. Now compare it with the sum one plus one half plus one third, continuing through one over n. The sum can be pictured as the areas of rectangles placed alongside the curve one over x.

  31. Simon

    Each rectangle has width one and height one over its index. These rectangles approximate the area under the curve, but in this arrangement they sit mostly above it, so the sum is larger than the integral. That explains why the harmonic sum is close to the natural log of n, but not exactly equal to it.

  32. Michael

    The difference between the harmonic sum and the natural log approaches a fixed value as n grows. That constant is called Euler’s constant, or the Euler–Mascheroni constant, and it’s about 0.577. So the natural log gives the main growth, while the constant describes the limiting offset.

  33. Simon

    We still owe an explanation for why the alternating harmonic series equals the natural log of 2. The trick is to generalize it first. Instead of only looking at one minus one half plus one third and so on, consider x minus x squared over two plus x cubed over three, continuing with alternating signs.

  34. Michael

    That may seem like making the problem bigger, because now we have a whole function of x to understand. But its derivative simplifies beautifully. The derivative is one minus x plus x squared minus x cubed, and so on. Each term is obtained from the last by multiplying by negative x.

  35. Simon

    That makes it a geometric series. Its sum is one over one plus x, at least for values of x where the series converges. So the derivative of our generalized alternating series is one over one plus x.

  36. Michael

    Now integrate that derivative from zero to one. The antiderivative is the natural log of one plus x. Evaluating at one gives the natural log of 2, and evaluating at zero gives zero. Therefore the integral is the natural log of 2.

  37. Simon

    On the other hand, integrating the derivative from zero to one gives the original function evaluated at one minus its value at zero. At one, the function is one minus a half plus a third minus a fourth, and so on. At zero, it’s zero. That proves the alternating harmonic series equals the natural log of 2.

  38. Michael

    The path to that result is a good example of mathematical problem solving: generalize a question, look for a pattern in derivatives, recognize a geometric series, and then use an integral. Each step connects familiar ideas, even if the whole chain feels like a magic trick at first.

  39. Simon

    And that’s the broader theme. Natural logarithms appear in prime density, in infinite sums, in growth estimates, and as the inverse of exponential growth. The constant e is especially convenient because its exponential has a derivative equal to itself, making rates of change and logarithms fit together naturally.

  40. Michael

    So the next time a sum of reciprocals or a prime-counting estimate produces a natural logarithm, it’s not an isolated coincidence. The same underlying relationships are showing up in different forms—and learning to recognize those patterns is one of the pleasures of mathematics.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent