Asympprimes
Asympprimes
Our goal in this chapter is to show one of the great theorems of mathe-
matics.
Equivalently
s
X n
vp (n!) = ⌊ ⌋ with s = ⌊logp n⌋ (7)
i=1
pi
When i > ⌊logp n⌋, p < ni so the addend in (6), explaining the equiva-
lence. The argument with p = 7, n = 100 easily generalizes. For any i ≤ s
there are ⌊np−i ⌋ numbers 1 ≤ j ≤ n that have (at least) i factors of p. We
count each such i and j once, as then an i with precisely u factors of p will
be counted precisely u times.
We apply Theorem 1.5 to study binomial coefficients. Let n = a + b and
set C = na = a!b!
n!
. Applying (7)
s
X n a b
vp (C) = vp (n!) − vp (a!) − vp (b!) = ⌊ ⌋−⌊ ⌋ − ⌊ i⌋ (8)
i=1
pi p i p
This term is zero if the fractional parts of α, β sum to less than one and one
if they sum to one or more. The sum (8) consists of s = ⌊logp n⌋ terms, each
one or zero, and so lies between 0 and s.
Remark: With n = a + b there are two arguments why a!b! divides
n!. One: the proof of Theorem 8 gives that, for all primes p, vp (n!) ≥
vp (a!) +vp (b!) = vp (a!b!) and thus a!b! divides n!. Two: The quotient
n! n
a!b! = a counts the a-subsets of an n-sets and hence must be a nonnegative
integer. Which proof one prefers is an esthetic question 1 but it is frequently
useful to know more than one proof of a theorem.
There is an amusing way of calculating vp (C) with C = na and a+b = n.
Write a, b is base p. Add them (in base p) so that you will get n in base p.
Theorem 1.7 vp (C) is the number of carries when you add a, b getting n,
all in base p.
45
+ 34
----
112
pαi i ≤ n (12)
Thus !
n
≤ nr (13)
n/2
n
Stirling’s Formula gives an asymptotic formula for n/2 but here we use only
n
the weaker n/2 = 2n(1+o(1)) . Taking ln of both sides of (13) and dividing
gives
n
ln n n/2
π(n) = r ≥ =
(ln 2)(1 + o(1)) (14)
ln n ln n
What if n is odd? In Asymptopia we simply apply (14) to the even n − 1.
Thus
n−1
ln (n−1)/2
π(n) ≥ π(n − 1) ≥ (15)
ln(n − 1)
n
which is again ln n (ln 2)(1 + o(1)).
bound on π(n) − π(k + 1). We combine the even and odd cases by writing
n n
π(n) − π(⌈ ⌉) ≤ (ln 2) (19)
2 ln(n/2)
Now we use the trivial bound π(xu ) ≤ xu ≤ n ln−2 n. While this is a “bad”
bound for π(xu ) it is a negligible value for us and
u−1
n X xi
π(n) ≤ o( )+ (ln 2) (22)
ln n i=0
ln(xi /2)
Thus
u−1
X xi 1 + o(1) u−1
X
(ln 2) ≤ xi (24)
i=0
ln(xi /2) (ln n)(ln 2) i=0
Now x0 = n and xi ∼ n2−i (indeed, to be totally formal, xi ≤ n2−i + 1) so
that
u−1
X
xi ≤ 2n(1 + o(1) (25)
i=0
so that
2n ln 2
ln(VSP ) < (1 + o(1)) (29)
K
While this is not a small number in absolute terms it will be relatively
small compared to the total contribution which is 2n(1+o(1)) .
n
For 1 ≤ i < K we now look at Vi . As all primes considered have p > K
√
and K is fixed they have p > n. Thus the sum of Theorem 1.5 has only
one term. Theorem 1.6 with a = n/2 is then simply
!
n
vp ( = ⌊n/p⌋ − 2⌊n/2p⌋ (30)
n/2
This is either zero or one and is one precisely when ⌊n/p⌋ is odd. We
have designed Pi so that ⌊n/p⌋ = i for p ∈ Pi . When i is even no primes
p ∈ Pi appear in the factorization (11) (or, the same thing, they appear with
exponent zero) and so Vi = 1. (For example, with n7 < p ≤ n6 , n! has six
factors of p and (n/2)!2 has twice three factors of p and they all cancel.)
Now suppose 1 ≤ i < K is odd. Then Vi is simply the product of all
n
primes p ∈ Pi . Each such prime p lies between K and n and so can be
considered p = n 1+o(1) . The number of such primes is π(n/i) − π(n/(i + 1)).
In this range ln(n/i) ∼ ln n. Our assumption for Theorem ww3 then gives
that π(n/i) ∼ c i lnn n and that that π(n/(i + 1) ∼ c (i+1)n ln n . We deduce
that the number of primes is ∼ c lnnn ( 1i − i+1
1
. (Caution: Subtraction in
Asymptopia is dangerous! It is critical here that i ≤ K and that K is a
fixed constant, so 1i and i+1
1
is a positive constant. Were, say, K = ln ln n
we could not do the subtraction. With i ∼ (ln ln n)/2, for example, the
asymptotics of π(n/i) and π(n/(i + 1) would be the same and so one could
not deduce the asymptotics of their difference!) Thus
1 1
Vi = nc(1+o(1))(n/(ln n))( i − i+1 ) (31)
and
1 1
ln(Vi ) ∼ cn( − ) (32)
i i+1
From the factorization (11) Then
!!
n X
ln = ln VSP + ln(Vi ) (33)
n/2
We can now see the idea. The ln(VSP ) will be negligible and (35) becomes
ln 2 = c(ln 2). The actual argument consists of eliminating all c 6= 1.
P −1 (−1)k+1
Suppose c > 1. Select K = 2T so that c 2T k=1 k > ln 2. As
ln VSP ≥ 0 the right hand side of (35) would be bigger than the left hand
side.
Suppose c < 1. Applying the upper bound (29), the right hand side
P −1 (−1)k+1
of (35) would be at most c 2T k=1 k + 2Kln 2
. As K → ∞, this sum
approaches c ln 2 which is less than ln 2. Thus we may select K 5 so that
4
Again, from Calculus!
5
A subtle wrinkle here, while we examine behavior as K → ∞ we select K a constant,
dependent only on c.
this sum is less than ln 2. But now the right hand side of (35) would be
smaller than the left hand side.
Both assumptions led to a contradiction and since we assummed that c
existed, it must be that c = 1.
1.5 Telescoping
Suppose we have a reasonable function f (x) and we wish to asymptotically
P
evaluate p≤n f (p). We assume the Prime Number Theorem 1, giving the
asymptotics of π(s) as s → ∞. On an intuitive level we think of 1 ≤ s ≤ n
as being prime with “probability” π(s)/s ∼ 1/(ln s). Then s, 1 ≤ s ≤ n
would contribute f (s)/(ln s) to the sum and p≤n f (p) would be roughly
P
s≤n f (s)/(ln s). This is not a proof, integers are either prime or they
P
aren’t, yet surprisingly we can often get this intuitive result. The key is
called telescoping. We write
X n
X
f (p) = f (s)(π(s) − π(s − 1)) (37)
p≤n s=2
The first term of (38) is then ∼ n1 lnnn = o(1). The sum is asymptotically
P s 1 P 1
ln s s(s+1) ∼ s ln s , the sum from s = 1 to n − 1. From Chapter xxx,
n−1 n
1 dx
X Z
sin = ln ln n (40)
s=2
s ln s 1 x ln x
That is, F (n) ∼ ln ln n. For another example, take f (s) = s so that F (n) =
p≤n p. Then
P
n−1
n2 n−1 s
X Z
F (n) = nπ(n) − π(s) ∼ − ds (41)
s=2
ln n 2 ln s
While the integrand cannot be precisely integrated we can handle it in
Asymptopia. Our notion is that ln s ∼ ln n for “most” 2 ≤ s ≤ n − 1.
We split the integral at some n1−o(1) , let us take u(n) = n ln−10 n for defi-
niteness. For u(n) ≤ s, ln(s) ≥ ln n − 10 ln ln n ∼ ln n so that
n−1 s n−1 s n2
Z Z
ds ∼ ds ∼ (42)
u(n) ln s u(n) ln n 2 ln n
s
For s ≤ u(n) we bound ln s ≤ s so that
u(n) s u(n) n2
Z Z
ds ≤ sds ∼ (43)
2 ln s 0 2 ln20 n
As the upper bound (43) is o(n2 / ln n) it has a negligible effect and the total
integral
n2
Z n−1
s
ds ∼ (44)
2 ln s 2 ln n
Subtracting, (41) gives
X n2 n2 n2
p∼ − ∼ (45)
p≤n
ln n 2 ln n 2 ln n