Lower and Upper Bound Divisor Function
Lower and Upper Bound Divisor Function
© W. F. Esterhuyse*
May 2009
ABSTRACT
We prove a method for finding lower bounds for the divisor function:
σ 0
(n). The method does not involve explicit computation using the
cos (2π q) for q a rational number. The lower bounds found are
beter than the trivial case and the formula can be extended to get
* email: [email protected]
CONTENTS:
1. Upper Bounds
Bibliography
1. Upper Bounds
We start with the result from ref. [3] for computing the divisor function σ 0(n) = d (n):
d(n) =
n µ
∑ µ ^(-1) ∑ cos(2π *ν *n/µ ). (1)
µ =1 ν =1
The integral corresponding to this does not give a tight enough upper bound,
The method we use indstead depends on finding the smallest number of form
m! and larger than n in d(n). Since the set of numbers of form m! is sparse we
The bound:
may be used (it may be tighter or not than our main method depeding on n).
This follows from the rule that we only have to divide by numbers < √n to
1.1 Lemma
Proof:
1*2*3*...*m
The first term counts the amount of factors. The second term counts a pairwise
reordering except pairs including 1 i.e. 2C(m-1), the third term counts a triple
Set mn = min { m in IN : n < m! }.
1.2 Theorem
We have:
Proof:
By Lemma 1.1 and since n < m! and numbers of form m! have the maximum amount
Since in general we need to find a number closer to n than m! in order to get a
1.3 Theorem
Proof:
1*2*3*...*k
Notation: <a the "a" subscript invokes the "all" quantifier on the string of numbers
it is used with.
1.4 Theorem
If 1 <a v1, v2, ... vk <=a m and vi <> vj for all i <> j <= k then
Proof:
Given a number n using theorem 1.4 we can get closer to our target by finding
close to and larger than m!/2 say then it is too far from m! and we may see if
(m+1)!/2 is smaller.
with columns in T and rows in T ∪ S) = A. Set CN = (the amount of compisites <= N). Set
[a] = |{n ∈ T : a | n}| and with continuation: [a, b, c,...] = |{n ∈ T : a and b and c and ... |
n}|
for some constants a, b , c etc. All references to composites and primes in this chapter
will
or c or ... = [[a,b,c, ... ]], where we do not count any composite more than once if
divisable
by more than one of a,b,c, .... Set [[a,b,c, ... ]]N,T = |{n ∈ T : a or b or c or ... | n, n <= N}|,
We use first the division submatrix A, and find a way to compute formulas for the
amount
of composites in T. Note that we may obtain an upper bound for primes in T from a lower
and term three (t3) is because we counted twice (using [5] + [7]) if both 5 and 7 divides n.
RHS of (1) counts composites for N < 11*13 exactly and C11*13 + k >= [[5,7]] since the
g1 = B1 CN.
combination operator" and is used to combine formulas, and the level of evolvement is
behaves as will be illustrated next. We illustrate it's behaviour for this start value (g1)
and state it in general in method 1.3, in order for the reader to get a feel of it first.
follows:
Now our operator comes into play: we need to combine formula (1) and (2), i.e.
B2 CN = g1 Km g2 (3)
such that B2 CN counts [[5,7,11]]N exactly. There exists a number m such that Km
evolves to "plus" (by definition). Where the index on Km will be explained. We write
out (3):
and since Km is a formula operator we know that it operates on the entire formulas to it's
left and right. We leave out the N subscript and reinsert it at the end of the computation.
(the naive "result" of (4)). The m = 1 refers to the amount of numbers in braces in LHS
that
The operator says we need to consider all singletons in braces in LHS (we haven't
considered [5] yet). We do it now. Since we already counted [5] we counted too much
by one (by term [11]) just in case 5,11 divides n. Therefore (5) evolves to:
And the operator evolved to it's level 2 state (which means we have to consider pairs in
braces next). By extension of step form (5) to (6) we need to add a term of
m+1 = 2+1 = 3 numbers in braces when considering pairs. The only possible such
triple is [5,7,11]. K2 executes as follows. We boldify all pairs that have a number in
-1
then for every bold term in RHS we add the coefficient of this number to the previous one
(left
-1 0 -1 -2 (9)
where these numbers are not the vlaues (they are computuations based on the assigned
number).
2.1 Theorem
where a = 1 from -2 + a = -1 and -2 is the rightmost and -1 is the leftmost number in (9).
Proof:
We just need all possible configurations of the matrix A involving rows 5, 7 and 11. This
is
Figure 2.1
Set [b]c = |{n ∈ T or S : b | n, n in characteristic matrix of A}| with the same extension as
Now [5]c counts the number of 1's in the first row, [7]c counts the amount in row two and
counts the cases [5,7]c twice, -[5,7]c corrects this. [11]c counts the amount of 1's in row 11
and counts cases of [5,11]c and [7,11]c too much and the case of [5,7,11]c too much, we
thus have:
6 + 4 -2 - 2 + a(1) (11)
We get the -2's by analog to [5]c + [7]c - [5,7]c which would have counted as: 4 + 4 - (the
amount of columns with 1's occuring in both row 5 and 7) = 4 + 4 - 2, the minus coming
We included the the (1) in (11) which was read off the characteristic matrix (one column
[[5,7,11]]c = 7
which proves the theorem for the characteristic submatrix. This translates directly to the
theorem just by dropping the "c" subscript since we may compute every term
(individually) in the full matrix A with columns <= N.
The reader need not concern about the spacings or order in the characteristic matrix,
any
reordering of it column by column would give the same result (one would not count
differently). This is easy to see but left to the reader to verify. The value for N follows
because 13*17 is the first number divisable by a value larger than 11 above the square
root
boundary.
We see that we could have assigned any number to LHS (9). If we assign 0 to LHS then
in the following.
1.3 Method
1. We take Km as non-associative:
g1 K m g2
(g1 Km g2) Km g3
...
3. The two formulas to combine must be such that LHS follows the sequence in item 1
upto
the largest n in gn and RHS is the formula gn+1 such that it counts the amount of
composites determined form row c, d (for c < d and c,d are adjacent rows in A and and c
is
considered. This max m is equal to the number of entries in the longest term of LHS.
6. RHS of Km+1 takes as formula the RHS of Km for every m ∈ IN plus the terms
determined
by item 8 below, LHS of Km+1 stays the same as LHS of Km untill the operator evolves into
"plus".
7. K1 acts specially on one term (the singleton repeated on both sides) such that it
deletes
this singleton on RHS and then operates again on the so modified RHS i.e. for example:
[5] + [7] - [5,7] + [11] - [5,11] - [7,11] + [5,7,11] K1 [11] + [13] - [11,13]
The other singletons occuring in LHS are handled as the trivial case of item 8.4 i.e.:
0 1 1
0 1 1
Or in general:
0 1 ... 1
and make a note to add: k = -1, k[a,d] to RHS (on evolution of K1 to K2) and redo item 7
8. For every m >= 2 boldify a single term (say tn) with m entries in LHS
8.1 Boldify the singleton in RHS and every term in RHS having an entry in common
with
tn.
8.2 Assign the number 0 to the LHS, place it in the next row below the formula to the
left
of Km.
8.3 Add to the 0 of item 8.2 the coefficient of the first bold term in RHS and write the
number below the term (like in the second row of the diagram below).
8.4 Add the coefficient of the following bold term to the number obtained in (8.3 or
previous iteration of 8.4) and add 0 if the term is not bold. Write the numbers
obtained below the term. Redo 8.4 untill reaching the rightmost term.
0 1
0 1 0
0 1 0 0
(8.3 combine with 8.4 like in the above diagram just with the underlines deleted and the
8.5 When the computation of 8.4 terminates note the k = - (rightmost number) and term
8.6 Now the term to add after all terms of m entries has been considered is k[entries of
tn ,
8.7 List the terms so created and add them to RHS when advancing to m+1.
9. Increase m and redo item 8 untill m reaches the maximum number of entries of LHS
and
then change Km into "plus" on doing item 8 for the last time.
9. Km evolves fom m = 1 untill we reached a state in which all RHS terms are boldified.
End Method.
We may choose g1 as [[a,b]] for a and b in adjacent rows of A, not a = 5, b = 7 but then
you can't say the result: [[a,b]] Km [b] + [c] - [b,c] counts all the composites in A smaller
than d*e (c, d and e are adjacent rows and c<d<e) , it counts all composites determnied
from the three rows while leaving out some from the previous rows af A. Such a choice is
not usefull to determine a lower bound since the most composites in A are divisable by 5.
To continue the process (improving the bound) we construct the numbers divisable by
11 or 13:
We already proved:
g1 Km g2 = [[5,7,11]]
so we combine these:
B3 CN = [5] + [7] - [5,7] + [11] - [5,11] - [7,11] + [5,7,11] Km [11] + [13] - [11,13] (15)
We consider [5,7] in LHS and therefore the compensation for [5,7,13] and do the
boldifying,
B3 CN = [5] + [7] - [5,7] + [11] - [5,11] - [7,11] + [5,7,11] K2 [13] - [5,13] - [7,13] - [11,13]
0 1 0 -1 -1
B3 CN = [5] + [7] - [5,7] + [11] - [5,11] - [7,11] + [5,7,11] K2 [13] - [5,13] - [7,13] - [11,13]
0 1 0 0 -1
also giving a = 1, and 1[5,11,13]. One sees that the boldification due to [7,11] will also
give
an a = 1 and +[7,11,13] thus:
We consider braces with 3 numbers therefore compensation for [5,7,11,13] and do the
0 1 0 -1 -2 -1 0 1
so: a = -1, and we reached our maximum on m therefore K3 evolves into "plus":
We prove:
2.2 Theorem
Proof:
We already have (g1 Km g2)N = [[5,7,11]]N. Counting [[5,7,11,13]]N (columns with at least
[[5,7,11,13]]c = 15
We count B3 CN like in theorem 2.1 using the characteristic matrix with respect to
divisability by 5,7,11,13 (easily obtained from the characteristic matrix of theorem 2.1).
This matrix has 1C4 + 2C4 + 3C4 + 1= 15 columns (see figure 2.2).
The value for N follows because 17*19 is the first number divisable by a value larger
On the following improvement (division by 17) we have an exact count for all
composites < = 17' * 17'' - 6 = 19*23 - 6 = 431, if we can compute the terms exactly
B4 CN = [5] + [7] - [5,7] + [11] - [5,11] - [7,11] + [5,7,11] + [13] - [5,13] - [7,13] - [11,13]
We may continue by studying the formulas statisticly or use the method for computing
by
We may use this formula to compute π (x) exactly upto x = 17' * 17'' - 6 the sucessors
where T refer to the columns in T division submatirx and S to the columns in S submatrix.
for x <= 437. The first term (19) is computed by solving for k in 5 + 6(k-1) = y where y is
the
largest member of T <= x and similarly for first term (20) as 1 + 6(k-1) = y where y is the
largest member of S <= x. The floor function is here taken as T or S valued in the two
cases.
where 5*7 = 35 is the first number divisable by 5 and 7 in T. The 6 multiplier is since
we work modulo 6.
We proceed to compute these more effectively. For this purpose we need the
following:
2.3 Definition:
For some numbers N ∈ T we define the first twin divisors (a,b) of N (if they exist)
as: a < b and a and b are adjacent rows of A and a, b | N and a,b (both) does
We call the stair pattern of first twin divisors "s1". And count the step number in s1
For [7]N,T we computed values as a function of step number and fitted a linear function
since rows in A are alternately in T, S, T, S .... Where m is then the index of the row
2.4 Theorem
The first twin divisors define a stair type pattern in A and coincides with the square
root boundary at floorA (sqr N) at N any member of T having first twin divisors (i.e at
Proof:
the successor being counted in T ∪ S. The equality with N is since N has first twin
Note a*(a+2) ≈ a*a and the floorA function discards the fraction upto max [0, 2)
and this time floorA discards upto max [0, 4). The reasoning is anologous
Since the terms in (18) behave more regularly as a function of step number (m) in
s1 as (23) shows it is desirable to compute for any N ∈ T at what step number in s1
we are. We know the first twin divisor stairs (s1) is also on the square root boundary
by iteration starting at N and iterative subtraction of 6. The twin divisors to test with
would be at floorA (sqr (N)) and floorA (sqr (N)) - 2 or at floorA (sqr (N))
and floorA (sqr (N)) + 2 if m is odd. By theorem 2.4. If m is even the same applies
except replace 2 with 4 because the even steps are at intersection of rows that are
4 apart. By theorem 2.4 the twin divisors obtained like this are guaranteed to be first
twin divisors. Actually since we are seeking m we first determine if m is odd or even
by iteration and testing all 8 possible twin divisors before the next subtraction. When
where the floor function value is in rows of A and s1 is between this number (row)
and the next member of T ∪ S. Then plug the row value into (24.1) or (24.2) to
we need only four discardable storage locations. This may be calculated by:
2.6 Defintion
We call terms of e entries "at the level m of Bm" as the terms of e entries that got
where m is the minimum such that Bm CN counts [[5, ..., a]]N exactly. Set the amount of
"[]" for "occurrance of a number" with one instance of it not necesarily equal to another.
The terms Ta,m has a largest entry the (m+1)'th member of T ∪ S, where m and N
For example T17 = the amount of terms with an entry of 17 in (18) = 15, σ a
=5
The storage locations needed for storing the computing formua can be reduced
to an array of size equal to the amount of terms (and even further upon noting the
We need placeholders with two indices i.e.: te,m for efficiency because we store the
coefficient in te,m and e specifies the amount of entries in the term and m the level
of Bm. Then the term is reconstructible as by computing like with Km and noting the
entries are in T ∪ S. For example the coefficient t3,3 is that of terms with three
t3,3 = 1 and the terms reconstruct as all combinations of three of 5,7,11,13 into [ , , ]
times 1 and 13 must be in each of them. Note that in this reconstructing we would
ignore terms of three entries that arrived at level m < 3 of Bm. (in this example there
was none). In general te,m would not be the coefficient of terms of e entries that
arrived at level m - 1 of Bm-1. For every m the m'th member of c must also be
We therefore need in terms of storage space less than: four discardable (reusable)
storage locations of bitlength equal to the bits of x, plus the amount of terms in Bm CN
plus the locations to compute the m'th member of T ∪ S plus two more reusable
locations to form the product te,m*[ ...]N and an accumulator to store the sum in.
The bulk of the storage locations are the coefficients of the formula. This number
s17 = 15 for x = 17' 17'' - 6 so that s17 < x1/2. The storage efficiency may be improved if
we can get an invariant way of predicting which coefficients will be equal to 1 or -1. In this
case s17 = 3 < x1/5 which would be a marked improvement over the Extended
Meissel-Lehmer algorithm ref. [3] if it holds for all x. sa also decreases by theorem 2.9
and 2.10 below. We get a better bound on sa in theorem 2.11, 2.12 below.
2.7 Theorem
Ta,m = 1 + 1C(σ a
- 1) + 2C(σ a
- 1) + ... + (σ a
- 1)C(σ a
- 1)
Proof:
to 4. This pattern continues because a occurs in every term aquired at the level of m in
Bm
were we combine Bm-1CN K2 [a] - [[], a] - ... - [[], a] and method 1.3 tells us to consider
hypothesis. m = σ a
- 1 because every advance on m adds one singleton and we started
2.8 Theorem
Let N = a' * a'' - 6 for any a in T ∪ S. The amount of terms in Bm CN that counts
[[5, ..., a]]N,T exactly is: 3 + T7,m + T11,m + ... Ta,m, where the indices are successive
Proof:
By theorem 2.7 and because Kp evolves to plus. The first term is T1,m + T5,m: the trivial
case.
We compute m = σ a
- 1 from the m of Bm such that minx,m holds because of:
2.9 Theorem
For any p >= 1 we have that for all terms arriving at Kp evolving to Kp+1 the coefficients
are equal.
Proof:
By noting that the amount of boldified terms for each p in Kp are equal and distributed
equally among p-lets because of the combinatorical order of LHS implied by theorem 2.7.
2.10 Theorem
For all p = 1, 2 we have the coefficient of singletons = +1, doublets = -1, triplets = +1 for
Proof:
By noting theorem 2.9 for p = 1, 2 and that for any m in Bm Cx at the K1 stage we have
the standard RHS and at the K2 stage we only have singletons and doublets in RHS and
2.11 Theorem
For m and x satisfying the minx,m criterion, the (permanent) storage space requirement
b4 = 6
bm = bm-1 + m - 2.
Proof:
Only storage for coefficients for the last addage of terms are required (as m advances
by
s17 = 3
(max k) - 2 sets of terms of same coefficient (not terms of 1, 2, 3 entries) get added to
last Bm Cx so this number gets added to the next sa if mina,m criterion is valid and then
A subset of the terms of Bm CN may be zero when evaluated in T and another set in S.
These patterns must also be studied so that the reconstruction of the formulas in the
and
magnitude) this assumption is not strictly necessary since we can use the same formulas
(like 18) just computing the terms in the S division matrix. Where the primes are ristricted
to occur in T or S respectively.
| Li(x) - π T(x) - π S
(x) - 2 | <= c sqr(x) ln x (23)
or:
We use:
to obtain a benchmark on c.
We compute an exact count for x = 19*23 - 6 = 431 for which we can use B4 C431: (since
π T(19*23-6) = k - B4 CN = 72 - B4 CN.
131.15697 = c*125.93677
c = 1.041451.
If we can do an estimate for x large, plug it into (25) and get a c close to the above value
then we are approaching the right order of magnitude. And the smaller the k we need to