Welcome to my Math Notes.

Here you may find various subject notes, mostly as summaries of YouTube lectures, enjoy!

— erhant

Introduction to Number Theory

These are notes taken from Introduction to Number Theory - Berkeley Math 115 open lectures by fields medalist Prof. Richard Borcherds.

The textbook for the course is "An Introduction to the Theory of Numbers" by Niven, Zuckerman, and Montgomery. (5th edition)

  1. Introduction: In the first two lectures, a survey of some of the topics covered later in the course is given, mainly about primes and Diophantine equations. The survey continues with some more problems in number theory, and some discussion is made about congruences, quadratic reciprocity, additive number theory, recreational number theory, and partitions.
    youtube link youtube link

  2. Divisibility: This lecture covers basic properties of divisibility, and Euclid's algorithm for finding greatest common divisors. Then, we discuss how to solve linear equations in integers using Euclid's algorithm. Finally, we discuss some basic properties of primes and prove the fundamental theorem of arithmetic.
    youtube link youtube link youtube link

  3. Arithmetical Functions: Arithmetical functions are functions that are defined on positive integers; they are quite interesting. In the lecture, we give some examples of multiplicative functions and show how to calculate them. As an application we discuss even perfect numbers.
    youtube link

  4. Binomial Coefficients: The number of ways you can choose some elements from a set becomes something really cool real quick. In these two lectures, we review the definitions and basic properties of binomial coefficients. Then, we discuss some applications of binonial coefficients, such as an approximate estimate for the number of primes less than , and the Catalan numbers.
    youtube link youtube link

Primes

Primes are numbers divisible by 1 and itself, such as 2, 3, 5.

How many primes are there? There are infinitely many primes. Proven as follows:

  1. Suppose there are finitely many
  2. Find .
  3. Let be a prime factor of this number. It cant divide any prime known so far, because that would mean it should divide 1 too. So, is a new prime.

How can we find large primes? Mersenne primes are in the form for prime . There are also Fermat primes, of the form . Gauss discovered that regular polygons with the number of sides equal to a Fermat prime can be constructed using a ruler and compass.

Note that

If odd, then divides .

Is there an easy way to generate large primes? In other words, is there a non-constant polynomial such that the result is a prime? NO! To prove, suppose you have . If then is composite. If , then you can find that has the same argument.

How many primes are there up to a given value? This is famously shown as . Gauss found that . Informally, a number has a chance of being prime with probability .

Suppose we want to find prime powers too, where is counted as . Denote this as . Let (limit integral). Riemann amazingly found that:

where is the zeros of the Zeta function! By the way, throughout this course always refers to the natural logarithm.

Fundamental Theorem of Arithmetic

Every integer is a product of primes in a unique way (up to order). Euler interpreted this as a factorization of the Zeta function:

This makes a lot of sense if you think the geometric series of the product terms:

You can choose for example , and 1 everywhere else, to obtain . This also provides a proof or infinitude of primes: is a diverging harmonic series. So, the product should also be infinite, which requires infinitely many primes!

Diophantine Equations

These are the equations where we seek integer solutions.

  • (Pythagoras)
  • which means find . This surprised ancient Greek people who thought all numbers were rational!
  • for and . (Fermat's Last Theorem)

It turns out that finding solutions to most Diophantine Equations are hard.

Hilbert's 10th problem asks: Is there an algorithm to solve all Diophantine Equations?

The answer turned out to be no! (Robinson, Davies, Putnam, and later Matiyasevich).

Congruences

Question: Is 1234567 a square?

No, because the last digit is not possible to be 7 for square numbers. So we kind of look at the number in modulo 10. Modulo is really useful in these kind of questions. We write them as:

This notation is by Gauss, and it means that is divisible by . In other words, .

Question: Can you solve ?

You can realize that . Then . So, the number can not have 3 as the last digit, thus the equation does not have any integer solutions.

Fermat's Little Theorem

Fermat's little theorem is an awesome little theorem, that states:

Euler also found that for coprime and number of integers less than an coprime to . For example:

Suppose you want to test if is prime for very large . We can check if (which can be done efficiently).

  • If not, then is definitely not a prime.
  • If yes, then we do not know, but it could be a prime.

For Diophantine equations, if then . The reverse is not always true, and Hasse Principle describes that. If the latter turns out to be true for all , then most likely .

Quadratic Residue

Can we solve for some prime ? Here, we refer to as the quadratic residue. Legendre symbol is a pretty useful notation about this:

Quadratic Reciprocity

Euler found a relationship between and for odd primes.

  • if has an integer solution.
  • if has an integer solution.

What Euler discovered is that:

  • if or .
  • if and and of course .

This indicates that there is an amazing hidden structure in this seemingly unrelated equations. Such a feeling happens a lot in Number Theory!

Question: Is 3 quadratic residue of 71?

This is asking if . We can check instead if . This is easy to find, as and 2 is not a square, so .

Additive Number Theory

Goldbach Conjecture: Is every even number a sum of 2 primes? Examples are , and so on. The answer: we don't know! Chen managed to show that every even number is a sum of prime and a product of two primes (),

Twin Prime Conjecture: Are there infinitely many primes such that is also prime? We don't know this too, but Zhang proved that and for in the order of millions will always have a prime.

Arithmetic Progressions: Can you find arithmetic progressions of primes, such as ? Dirichlet has shown that any arithmetic progression in the form has infinitely many primes.

Recreational Number Theory

Perfect Numbers: A perfect number is equal to the sum of its proper divisors. Example: .

Amicable Numbers: Two numbers are amicable if the sum of their proper divisors give each other, such as 220 and 284.

Collatz Conjecture: Suppose you map for odd and for even . Doing this repeatedly, do you always reach to 1 in the end for all ? We do not know yet!

Sum of Digits: Many examples are there for recreational mathematics concerning digit sums. For example, .

Algebraic Number Theory

As an example of algebraic number, consider for . These are called Gaussian Integers and they have a unique factorization. For example, . Notice that . Sum of squares turn out to be quite special.

Fermat has shown that a prime can be written as . Quite surprising.

Combinatorial Number Theory

An example would be partitioning. is the number of partitions that you can write as a sum of smaller integers. because there are 7 different ways to write

It turns out that is divisible by 5, for seemingly no reason at all. Looking at the sum of:

Euler discovered that this is equal to:

Divisibility

If divides , we show this as . Note that this does not mean is defined, but rather means that for some integer . This allows to be 0 too.

  • is always true.
  • is false, unless too.
  • is a fancy way of saying is even.

Question: Show that for any .

We can prove with the argument that one of those terms is even and another is divisible by 3. However, there is a better argument. We can consider the binomial , which is the number of ways to choose 3 elements from values. This gives to choose 3 elements, and they can be ordered in 6 different ways so we divide by 6. Since we are counting the choices here, the result is definitely an integer. As such, 6 divides .

Question: Show that if is odd.

Rewrite as as it is odd. Now, . 4 is there alright, and if we can show that is even then the whole thing is divisible by 8. Well, rewrite that as and one of those is definitely even.

Definition: Set of such that is called ideal. For the integers (), ideal means "closed under + and -".

Euclid's Division Algorithm

Suppose we have integers . Then Euclid treats this as and we call the quotient, and the remainder. Key point: .

forms an Ideal (closed under +, -). The converse is also true, suppose that is ideal. Then, is the set of multiples of some .

Suppose has some (if not, then ). Pick the smallest . Suppose . Then, and . Now, because the Ideal was closed under addition and subtraction.

Since is the smallest element, this implies . So, and thus is the multiples of .

So, we applied Euclid's Division Algorithm to show that ideals of integers are exactly the same of multiples of some particular element.

Greatest Common Divisor

For , the greatest common divisor is the largest integer such that and .

  • If then there is no largest integer that divides both. For conventional reasons, we set .
  • To indicate GCD in elementary number theory, people sometimes use as the notation.
  • even if .

Naïve: How do we find the GCD? The naïve method is to check all numbers up to the smallest of the two, and find the first one that divides both. However, this is really slow.

We want a fast algorithm. By fast, we kind of mean that it takes a reasonable amount of time even if the numbers have hundreds of digits (there are more technical definitions).

Better: We can factor into primes. The GCD can be found by looking at the common prime factors (up to order). For example, and . Taking the maximum common factors in both, we get .

This is cool, but factoring large numbers is hard. So we are still not that efficient.

Cool: Euclid's Algorithm is very efficient. This is probably the oldest mathematical algorithm still in use. We will describe with an example.

We are given 78 and 14. We will do division with remainder, until the remainder is 0:

The answer is the latest quotient: 2. Note that we know this algorithm will terminate for sure, because the remainder gets smaller on each step. The algorithm kind of looks at the GCD as follows: . This comes from the fact that .

How fast is this method? Let us consider the worst case. We look at , and we want small . The worst case is when . For example, .

  • aaand we are done!

We notice that we can work our way up backwards, the remainders follow the recursive pattern for this example. Looks familiar?

Fibonacci Sequence

This sequence 0, 1, 1, 2, 3, 5, is the Fibonacci numbers. is the Fibonacci number, and the worst case of Euclid's algorithm is when we are finding .

Let us find out how fast does Fibonacci grows.

  • _Lower: 0, 1, 1, 2, 2, 4, 4, 8, 8, ...
  • Actual: 0, 1, 1, 2, 3, 5, 8, 13, 21, ...
  • ^Upper: 0, 1, 2, 4, 8, 16, 32, 64, 128, ...

This gives us the growths . In particular, we see that for some constant , and is the number of steps in Euclid's algorithm.

So, the number of steps of Euclid's algorithm which is approximately .

Is there a formula to find for ? This is an example of "Finite Difference" equation by the way. Note that "General Finite Difference" equations have the form:

for constants

The method to solve these equations is to literally guess the answer. That doesn't sound cool, so instead we say you find the ansatz (which means guess).

With ansatz we guess the form of the answer with some unknown coefficients. You could take a guess like , or perhaps for some constant . The constants should also be guessed in those. The latter guess seems to work quite nicely for Finite Difference equations.

Looking at , we have . So, . The solutions are . Hmm, that's not cool because those are not integers. But we do not give up. What if the answer is a linear combination of these solutions?

Now we will try to adjust to get the Fibonacci numbers. Thankfully, we know and . This gives us:

We thus find and . So,

Fibonacci numbers have quite a lot of cool and funny properties (proofs left as exercise):

  • is always a square.
  • .

The number is known as the Golden Ratio (shown as or sometimes).

Euclid's Algorithm to Solve Equations

Suppose we know and the problem is to solve . We can solve by using the same algorithm described in the previous section. For example, lets find . We first find the GCD:

The GCD is 1. Now we work our way backwards:

Et voila! We found , so and .

Note that is solvable if and only if . We can find the solution for and the just multiply the findings to reach . Also note that once you find , other solutions are possible such as . What about linear equations in 3 variables? Such as:

Well, we can solve two at a time, referring to (since ), giving us and . Then, we find (since ). There we find and .

Done! and .

Again, we can only solve if and only if . This actually works for an arbitrary number of variables!

The problem with Euclid's Algorithm is that it is using "long division", which is slow and complicated. For large numbers, computers don't really know how to do it, and you have to program it yourself. Even Intel got it wrong back in the day.

Long Division

We can avoid long division by being a bit more clever, and doing divisions by two only (which is really fast on computers). To solve we do as follows:

  1. Take out all factors of 2 from and . And now assume that and both are odd.
  2. Change to . Now has to be even.
  3. If the result is 0, stop.
  4. Otherwise, take out the factors of 2, and go back to step 2.

Least Common Multiple

Given and , the least common multiple is the smallest number divisible by and , and is less than or equal to . For example, . It turns out that:

This is actually a bit obvious when we look at the factors.

Now notice that . Therefore, .

Primality Tests

A prime is an integer not divisible by anything except and . 1 is not a prime, because it is defined that way and it is very convenient to define it that way (although not everyone agree with them).

Alternatively, we could allow negative integers too such as . In that case: a prime is an integer such that if then or is a unit. A unit is something that has an inverse, and the only units for integers are and .

A naïve method would check if a number is divisible by anything smaller than itself . It is very inefficient. We speed up this by:

  • Checking only primes in the division
  • Checking up to

As such, the number of steps for this method would be . Even then, this is too slow if is large (like 100 digits or something).

For very large methods, you could first check if it is divisible for some small primes, and then go on to the more advanced test methods.

Fundamental Theorem of Arithmetic

Any number is a product of primes in a unique way up to order. Note that is a product of the empty set of primes (this is a nice convention).

Alternatively, allowing negative integers: any number is a product of primes and a unit (1 or -1) in a unique way up to order and then up to units.

Proof: We have two parts: an easy part for existence, and hard part for the uniqueness.

  1. Easy part (Existence): Take . If or is prime, then we are done. Otherwise where .

    So by induction, is a product of primes and is a product of primes and thus is a product of primes .

  2. Hard part (Uniqueness): Suppose is prime, and . Then, or . This is the central key result in order for this proof to work.

    Suppose , then as is prime. By Euclid, for some integers . Now multiply by to obtain . Well, divides and also divides , therefore divides (right-hand side).

    Now lets suppose . Then . So, for some , but is prime, so . You can repeat this by diving all the newly found . So, the factorization is unique up to order.

We can also give a similar result for polynomials over . Take . Here, the units are non-zero constant polynomials, and every non-zero polynomial can be written as a product of irreducible polynomials and constant polynomials.

Real numbers don't have primes, because any real can be written as

What about integers in the form , such as ? Well, you indeed have "primes" where the product is like . However, the factorization is not unique, e.g. .

Both examples (reals and number 1 mod 4) were not closed under addition and subtraction. Maybe that was the cause of non-uniqueness? Well, lets see one example that is closed!

Lets look at functions on reals . We can multiply, add or subtract them point-wise. Well, turns out we can't write functions as a product of "prime" functions, for example:

  • it goes on like that, and none of them are units.

Another example: take all numbers of the form where are integers. This is an example of algebraic number field. Well, this is not unique too, .

We will later see that number of the form have unique factorization! These are called Gaussian Integers. Units here are

Euclid's Proof of Infinitude of Primes

We have shown this in the first lecture. In three lines:

  • , so is a new prime.

Note that is not necessarily a prime! Thinking that this is the case is a common mistake.

Here is a cool question: suppose you find the primes following the proof described above (so you take in every step). You will get and such. Do all primes appear? We do not know, and it is very hard to check this, but it is almost certainly yes!

Suppose we take some prime, does 101 appear? Well, almost certainly yes! The change that it appears at step is . This is because we are dividing a number by 101 (so that ), which is possible every 101 numbers over integers.

So, the chance that it does not appear at step is . The chance it does not appear at step is . If you take a very large , this approaches 0. I really liked this proof!

Nevertheless, proving that all primes are given seems to be really hard. We have just no idea how to prove it.

Last Digit

We know that the last digit of primes should be 1, 3, 7 or 9 (other than 2 and 5 for their respective numbers). We may ask, are there infinitely many primes with the last digit 1, i.e. primes of form ? Dirichlet proved that yes, indeed there are!

Well, are there infinitely primes in the form where and ? Dirichlet's proof on arithmetic progressions actually prove that yes, there are infinitely many primes in all arithmetic progressions.

Let us check some easy cases. Take primes of form . Well, you could do a variation of Euclid's proof. Take number . This number is indeed of form , and:

  • It is not divisible by any of the .
  • It must have at least one factor that is not of form . This is because product of primes of that form result in too, so one prime must be of form for the result to be of form
  • Consequently, there must be a new prime factor of form .

You could do a similar thing for primes of form .

What about ? We can't use the previous proof on this one. However, we could notice the fact: if a prime is one that then or it is of the form (proof later). Now suppose you have a number:

We have 2 in there so that the result is odd, and square so that the result is of form which a prime can divide. All primes in there were of form or . The result is obviously not 2, nor any of the existing primes. So, there must be a new prime factor of that number.

Prime Gaps

Looking at we have varying amount of gaps. Is there a bound to the gaps?

The answer turns out to be no. It is easy to show, as you can take numbers and there will be numbers that are not prime. Well, is slightly less than . Turns out that the average size of prime gap is . It is very hard to show that gap is sometimes bigger or smaller than this.

Zhang has shown that gap is sometimes less than for large , in an amazing breakthrough. It has been reduced to a few hundreds recently.

It is believed that there are infinitely many consecutive primes with gap 2. It is also conjectured that the gap is sometimes . This seems to be very hard to prove.

Another crazy result by Rankin (1938) shows that the gap is sometimes bigger than:

Bizarre!

An arithmetical function is just a function defined on positive integers. or some other domain.

Strictly Multiplicative Functions

Take .

  • means that it is strictly multiplicative.

A simple example is .

Recall Legendre symbol from before, is strictly multiplicative.

Another strictly multiplicative function example is the Liouville function where is the number of prime factors. For example, so .

Notice that and therefore .

Multiplicative Functions

These are functions where when (they are coprime).

number of divisors

An example: which is just the number of divisors of . In this case, may be a bit laborious to compute by hand, but we can be more clever. Look at the factors of . So, its divisors can be of the form where . This gives us possibilities, which is our answer.

In general, given then . If two numbers are coprime, then .

sum of divisors

Another example is which is the sum of divisors. What is ? Again we can look at the factors and we take the sum as .

In general, given then and notice that these are geometric series, so . If for two primes then .

Euler's Phi Function

Euler's function is also a well-known multiplicative function. is the number of numbers and are coprime to . Turns out that if .

Ramanujan Tau Function

Take . Turns out that this is equal to: .

Ramanujan noticed that when .

Moebius Function

Let to be:

Turns out when . Well that is a pretty funny function right? Check this out: recall the Zeta function

If you look at its inverse:

Perfect Numbers

A perfect number is one that is equal to the sum of all its proper divisors. So any number where holds. Euclid gave a way to find perfect numbers in his Elements book. If you take where is a prime, this number is perfect. (easy to prove)

Euler found that even perfect numbers can only be in this form. Suppose where are odd primes. It has divisors:

Now suppose you take the sum . When you multiply these you have . Well, this is equal to

We have only taken a part of the sum of divisors, and we already have which was the condition to be a perfect number, so the remaining terms have the inequality:

On the other hand, notice that is an odd number within the whole sum, but our number is even (). So, there must be a smallest prime factor that divides (so that the result is not odd). This means that . This implies that

We have and at the same time, so that means this is in fact equal to 1.

Therefore, we see that we can't really have any other divisors other than , and . So, even perfect numbers must be of form: . This gives us even perfect numbers, but are there infinitely many even perfect numbers? We don't know yet, but probably yes.

Odd Perfect Numbers

Are there any odd perfect numbers? Well, nobody knows. This is quite an old problem, discussed around 2000 years ago! You could put some nice restrictions on it though. Suppose:

and . Looking at :

Notice that if is odd, the sum is even. Since the product should be , only one of these sums may be even, i.e. only one exponent can be odd. So, the other exponents are even numbers. This implies that is a prime times a square as in:

Landau's Hard Problems about Primes

  • Are all even numbers sum of two primes, ? (Goldbach)
  • Can we find infinitely many primes such that ? (Twin Primes)
  • Can we always find a prime for any such that ?
  • Can we find infinitely many primes of the form ?

We don't know the answer to these, we don't even have an idea on how to approach them. However, we believe the answer is yes.

Binomial Coefficients

We denote Binomial Coefficients as meaning ( choose ) and it corresponds to number of element subsets of an element subset. For example, . Binomial (roughly means "two names") corresponds to sum of two things. This is where the coefficients comes from:

There is an explicit formula for binomial coefficient:

More explicitly:

In that case, the numerator is number of ways we can pick elements, and the denominator is to handle the different ways we could have taken them. Pascal's triangle can also give you these results, but note that Pascal wasn't the first one to find that.

      1
     1 1
    1 2 1
   1 3 3 1
  1 4 6 4 1
// and so on..

Notice that this triangle tells us:

Even more, a number in the triangle is equal to the sum of numbers above it in the previous column. In other words:

This is very handy as we will see in a moment.

You could also have trinomials:

What should be the there? Well, the things we had for binomials are actually easily generalizable.

You could have a three-dimensional Pascal's triangle (like Pascal's Tetrahedron) and you would find these values. Let us look at the Pascal triangle again:

     1 // only 1s
    1 / 1 // all numbers
   1 / 2 / 1 // Triangular numbers
  1 / 3 / 3 / 1 // Tetrahedral numbers
 1 / 4 / 6 / 4 / 1 // 4-dim Tetrahedral numbers
// and so on..

In general, the column gives you the tetrahedral numbers.

Binomial Polynomials

Let us look at several cases:

Now, these polynomials have real coefficients but we are calculating ways to chose elements, so the result is integer. This is a very nice property, namely: if is an integer, then these polynomials result in an integer.

01000
11111
21248
313927
4141664

What if instead of we used ?

01000
11100
21210
31331
41464

The upper triangular part of this table is quite nice, the diagonal is just 1s and the upper part is just 0s. What if we wrote instead of in our polynomials?

This polynomial has a really nice property: the result is an integer for all if and only if are integers. We cant say the same for when we use , for example:

is always an integer perhaps? Let us use the binomial polynomial in an example. We remember from high-school:

How would we prove this? Well, notice that

Then, the sum of squares is:

Using the property we have shown above for the triangle:

Properties of Binomial Coefficients

First, let us rewrite the two properties we have shown before:

  • Pascal's Triangle:

  • Sum of binomials:

  • Complementing Coefficient:

  • Sum of the rows in Pascal's Triangle:

This can be interpreted (combinatorially) as: sum of number of 0 element subsets, 1 element subsets, , element subsets. This is equal to number of all subsets of a set with elements, which is . You can prove this with generative function with .

  • A Useful Sum:

It is cool to show this combinatorially (just draw two sets and try to pick elements in total from both).

  • Alternating Sums:
     1 = 1
    1 - 1 = 0
   1 - 2 + 1 = 0
  1 - 3 + 3 - 1 = 0
 1 - 4 + 6 - 4 + 1 = 0
// and so on..

You will always get 0. You can prove this both combinatorially, or with generative function by giving and .

Recall lattice paths problem, you can solve it using binomial coefficients. Furthermore, you can divide things up using binomial coefficients. For example, you have 5 pirates and you would like to divide up 100 gold coins. In other words: where are integers . Well, you could think of:

o o | o o o o | o ... o | o | o o

where o is a coin and | is a separator, so the coins between separator (and ends) denote the number of golds for a pirate. Well, this can be interpreted as: how many ways could we place these separators? There are 104 positions, and we have 4 separators, so the result is:

Let us look at binomial coefficients in modulo 2.

        1 // row 0
       1 1 // row 1
      1 0 1 // row 2
     1 1 1 1
    1 0 0 0 1 // row 4
   1 1 0 0 1 1
  1 0 1 0 1 0 1
 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 1 // row 8

This is just like Sierpinsky Triangle! Notice that when the row is a power of two, we get almost all zeros:

What if we do this with other primes? Let us look at modulo 3:

   1
  1 1
 1 2 1
1 0 0 1 // row 3

Indeed we get the same pattern at a power of that prime. This is a general property. For prime , and ; and furthermore . You can prove this by looking at the expression:

The numerator is obviously divisible by (which would give 0 in modulo ), and the denominator is only divisible by if or , which are the edge cases. This has a funny application. Take , you would get:

In modulo , you would only get . This is true for prime powers too.

So the property we have shown above is actually general to prime powers:

Dividing a Factorial

We would like to find how many times a prime divides . We can find this as:

where takes the integer part of . This is a finite sum, as when gets large enough the term would be . This formula just comes from looking at the number in as:

A rough estimate of this sum is just the series:

Q: How many zeros are there in the decimal representation of ? A: We can find this by checking how many times and divide this together (i.e., how many times divides this number). It is calculated from the above formula.

, , , and ; in total 249. We can do the same for , but the result will be larger than 249 surely, so we can say 10 divides this number 249 times in total and therefore there are 249 zeros in the end.

A similar method can be used to find how many times divides . For that, you find how many times divides , and then subtract how many times divides and .

How big is a binomial coefficient?

We sometimes want to know roughly how big a binomial coefficient is. A crude estimate is that we can have the upper bound:

since the sum of the row is .

We can also look at the middle coefficient (the largest coefficient) of a row:

which is because the sum of that row is and the largest one should be larger than the average of all them. Since there are values in row, we divide by .

Stirling's Formula

Stirling gave a brilliant formula to find .

If you put these into the factorials of binomial coefficient, you will also get a nice approximation.

Application to Prime Number Theorem

Recall that we want to know how many primes are there up to some number , which we show as . It was found that

We will show a weak form of this theorem, by showing:

so we can show this up to a factor of two. The key idea of the proof is to look at and look at primes dividing it. First we will find the upper-bound.

Suppose . Then divides exactly once. This is because the expression is:

and appears only once in the numerator. Now lets look at the product of primes between and :

How could we say that this is less than ? Well because any prime in between could only divide that binomial coefficient once, and since all those primes are in the numerator then the product itself can divide that by once. As such, the coefficient must be at least larger than the product of primes itself. We also know that the coefficient there is less than from a similar result.

Now lets take the logarithm of that inequality:

Also notice that

because the actual sum has # primes in terms in it but for any prime there is larger than . Then,

Using this estimate, you can find by repeatedly finding , and then and then and so on... We skip that technical detail. The result of this is going to be that # primes is bounded by about . You can make that 2 factor a bit smaller if you work really hard.

Now we will find the lower-bound. First we notice:

To show this, we must count # times divides and we know how to do this:

and so on… However, notice that each of these rows are either 1 or 0. Recall that in our condition , so the integer part of could only be 1 if . In that case, we would have . If then we just have and so the result can only be 1 or 0.

I really didn't understand this part above...

So we take the logs,

Here we can make some simplifying assumptions:

  • The number of terms with are small, as they are pretty rare, so we can ignore them.
  • is almost constant. If you look at the graph of it from to a really large , the graph looks almost like a constant line.

With these assumptions we can say that in the sum is very close to for most primes. What we then find:

So in the end we can say that # primes lies between about and .

Another application

If you look at the series for you have and these are divisible by . In fact,

What if we divide by ? We get the sequence Catalan Numbers:

The book "Catalan Numbers" by Richard P. Stanley lists 214 different sets that the Catalan Numbers count! Here is an example, where the numbers give us the number of ways to bracket a product:

1: a
1: ab
2: (ab)c | a(bc)
5: ((ab)c)d | a(b(cd)) | (ab)(cd) | (a(bc))d | a((bc)d)

Let us denote Catalan numbers by and . The property of this number is:

We can use generating functions to identify them:

Well then lets look at:

Turns out that:

Now this is just a quadratic equation, which can be solved by:

Remember that is:

Turns out that this is true for non-integers powers too!

These coefficients look a bit messy, but you can write them in a more clever way.