arXiv:0709.0885v1 [math.NT] 6 Sep 2007
TWO ALGORITHMS FOR EXACT EVALUATION OF THE NEWMAN DIGIT SUM AND THE SHARP EXTIMATES VLADIMIR SHEVELEV Abstract. We give P two simple algorithms for the exact evaluation of the sum S(x) = 0≤n 1, q > 1, m > 1 be integers, (p, q − 1) = 1. Put n=
v X k=0
k
ak q , 0 ≤ ak < q, σq (n) =
v X
ak .
k=0
Then the number of integers n < x satisfying n ≡ l( mod m) σq (n) ≡ t( x mod p) equals mp + O(xλ ), λ < 1, where λ does not depend on x, m, l and t. ln3 In particular, in the case of p = q = 2, Gelfond found that λ = ln4 . Thus, in this case for m = 3 we have (1)
X
1=
x + O(xλ ) 6
X
1=
x + O(xλ ) 6
n≤x:n≡l(mod3),σ(n)≡0(mod2)
and (2)
n≤x:n≡l(mod3),σ(n)≡1(mod2) 3 . with σ(n) = σ2 (n), λ = ln ln 4 Denote for x ∈ N, σ(n) = σ2 (n), m ≥ 2,
(3)
Sm,l (x) =
X
0≤n 0.
D.J.Newman [3] proved this conjecture. Moreover, he obtained the inequalities 1 < S3,0 (x)x−α < 5. 20 In 1983, J.Coquet [1] studied a very complicated continuous function F (x) with period 1 which is nowhere differentiable for which (6)
λ
(7)
S3,0 (3x) = x F
where
ln x ln 4
+
η(x) , 3
( 0, if x is even η(x) = (−1)σ(3x−3) , if x is odd
(8)
.
He obtained that
(9)
−λ
lim sup S3,0 (3x)x x→∞
55 = 3
3 65
λ
= 1.601958421 . . .
√ 2 3 = 1.154700538 . . . (10) lim inf S3,0 (3x)x = x→∞ 3 Unfortunately, show that if F (x) is indeed periodic with period 1 then (7) and (8) contradict one to another. According to (7) −λ
(11)
F
ln x ln 4
η(x) = S3,0 (3x) − x−λ . 3
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
3
Writing (11) for 4x and taking into account that 4λ = 3 and by (8) η(4x) = 0 we obtain (12)
F
ln x +1 ln 4
1 = S3,0 (12x)x−λ . 3
Because of the periodicity of F (11)-(12) yield (13)
η(x) = 3S3,0 (3x) − S3,0 (12x)
Now for x = 1, 3, 5, . . . by (13) we directly find η(1) = −1, η(3) = −1, η(5) = −1, η(7) = 1, η(9) = −1, . . . while by(8) η(1) = 1, η(3) = 1, η(5) = 1, η(7) = 1, η(9) = 1. . . .. Furthermore, Coquet in [1] did not say anything about the value of η(k + 1 ), k = 0, 1, 2, . . .. Let us show that if F is periodic such that 2 (14)
F
ln(k + 12 ) ln 4
=F
then η(k + 12 ) should be define as
ln(k + 21 ) +1 ln 4
1 η(k + ) = 3S3,0 (3k) − S3,0 (3(4k + 2)) + 3(−1)σ(3k) . 2 Indeed, note that
(15)
3 S3,0 (3k + ) = S3,0 (3k) + (−1)σ(3k) . 2 Therefore, by (11) we have
(16)
F
ln(k + 12 ) ln 4
=
σ(3k)
S3,0 (3k) + (−1)
η(k + 12 ) − 3
−λ 1 k+ . 2
Writing (11) for x = 4k + 2 and noting that η(4k + 2) = 0 we have (17)
F
ln(k + 12 ) +1 ln 4
= S3,0 (3(4k + 2)) · (4k + 2)−λ
and (15) follows from (14),(16) and (17).
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
4
Using the periodicity of F the process of the extension of the unique definition of η(x) (13), (15), . . . should be infinitely continuable. In our opinion, only after that there is a sense to say about representation (7) with an 1-periodic function F . Nevertheless, using a quite another method we shall confirm that (9) and (10) are true. Moreover, we shall prove that for x ≥ 2, x ∈ N, √ λ 55 3 2 3 λ x ≤ S3,0 (3x) ≤ xλ (18) 3 3 65 and, more general, for x ≥ 2, x ∈ N, (19) 55 x λ ⌊0.483459079 . . . x ⌋ ≤ ⌊2 ⌋ ≤ S3,0 (x) ≤ ⌈ ⌉ = ⌈0.670720518 . . . xλ ⌉. 6 3 65 Here the least integers on which the lower and the upper estimates attain are 3 and 19 correspondingly. Our method is based on a simple algorithm for the exact evaluation of S3,0 (x). It allows to calculate as well S3,1 (x), S3,2 (x) and S3·2k ,r (x), r ≤ 3 · 2k − 1 and to obtain for them the corresponding sharp estimates. In turn, our algorithm is based on Theorem 3 in [4] which is proved here much more simply. In conclusion we give a fast algorithm as well for exact evaluation of the Newman digit sum S3,0 (N) which is very suitable for experiments but not suitable for sharp estimates. λ
x λ
2. An algorithm for exact evaluation of S3,0 Let y = 2k1 + 2k2 + . . . + 2kr be the binary expansion of y ∈ N. Put (20)
t(y) = (−1)k1 + (−1)k2 + . . . + (−1)kr
Evidently, (21)
t(y) ≡ y( mod 3).
Denote (22)
S3,0 ([y, y + z)) = S3,0 (y + z) − S3,0 (y)
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
5
Consider an integer m ∈ [1, kr ). Below we use some trivial bijections of shifts such that the number of the integers divisible by 3 does not change. With help of (21) we see that the calculation of S3,0 ([y, y + 2m )) reduces to the following cases: a)t(y) ≡ 0( mod 6). Then (23)
S3,0 ([y, y + 2m )) = S3,0 (2m );
b)t(y) ≡ 1( mod 6). Then for any n > m2 , t(y) ≡ t(22n )( mod 3). Therefore, in the bijection of shift [y, y + 2m ) ←→ [22n , 22n + 2m ) the integers divisible by 3 in [y, y + 2m) correspond to integers in [22n , 22n + 2m ) which also divisible by 3. Thus we have (24)
S3,0 ([y, y + 2m )) = S3,0 ([22n , 22n + 2m ));
c)t(y) ≡ 2( mod 6). Then for any k > m+2 , n > m+1 we have t(y) ≡ 2 2 2k 2k−2 2n−1 t(2 + 2 ) ≡ t(2 )( mod 3) and thus as above we find (25) S3,0 ([y, y+2m )) = S3,0 ([22k +22k−2 , 22k +22k−2+2m )) = −S3,0 ([22n−1 , 22n−1 +2m )); d) t(y) ≡ 3( mod 6). Then, evidently, (26)
S3,0 ([y, y + 2m )) = −S3,0 (2m );
e)t(y) ≡ 4( mod 6). For any k > m+6 , n > 2 t(22k + 22k−2 + 22k−4 + 22k−6 ≡ t(22n )( mod 3) and
m , 2
we
have t(y) ≡
S3,0 ([y, y+2m )) = S3,0 ([22k +22k−2 +22k−4+22k−6 , 22k +22k−2 +22k−4 +22k−6+2m )) = (27)
= −S3,0 ([22n , 22n + 2m ));
f)t(y) ≡ 5(mod6). In this case, for any k > t(22k + 22k−2 ) ≡ t(22n−1 )( mod 3). Consequently, we obtain
m+2 , 2
n>
m+1 , 2
we have t(y) ≡
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
6
S3,0 ([y, y + 2m )) = −S3,0 ([22k + 22k−2 , 22k + 22k−2 + 2m )) = = S3,0 ([22n−1 , 22n−1 + 2m ));
(28)
Thus, to calculate S3,0 ([y, y + 2m )) it is sufficient to find S3,0 (2m ) and S3,0 ([2n , 2n + 2m )). n > m. Below (Section 3) we shall prove the following theorem. Theorem 1. (29)
m
1)S3,0 (2 ) =
(
m
2 · 3 2 −1 , if m is even, m−1 3 2 , if m is odd, m ≥ 1;
(30) m −1 3 2 , if m is even, 1 ≤ m ≤ n − 1 m−1 1)S3,0 ([2n , 2n + 2m )) = 3 2 , if m and n are odd, 1 ≤ m ≤ n − 2; 0, if m is odd, n is even, 1 ≤ m ≤ n − 1. In addition to Theorem 1 note that for odd N ≥ 1
(31)
S3,0 ([N − 1, N)) =
(
(−1)σ(N −1) , N ≡ 1( 0, otherwise
mod 3)
With help of formulas (23)-(31) one can easily calculate S3,0 (x) for any x ∈ N. Example 1. Newman mentioned in [3]about numerical studies by I.Barrodale and R.MacLeod that beard out of the Moser‘s conjecture up to 500000 and obtained that S3,0 (500000) is around 17000. Let us do an exact calculation. Using (23), (24), (28)-(30) we have S3,0 (500000) = S3,0 (218 + 217 + 216 + 215 + 213 + 28 + 25 ) = = S3,0 (218 ) + S3,0 ([218 , 218 + 217 )) + S3,0 (216 )+ +S3,0 ([216 , 216 + 213 )) + S3,0 (213 ) + S3,0 ([213 , 213 + 28 ))+ +S3,0 (25 ) = 2 · 38 + 0 + 2 · 37 + 0 + 36 + 33 + 32 = 18261. 3. Proof of Theorem 1 Similar to (22) denote for Sm,l (x) (3), (32)
Sm,l ([y, y + z)) = Sm,l (y + z) − Sm,l (y).
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
7
First of all, for any x, y ∈ N, it is easy to see that (33)
S6,0 ([2x, 2y)) = S3,0 ([x, y)).
Thus, since (34)
S3,0 ([2x, 2y)) = S6,0 ([2x, 2y)) + S6,3 ([2x, 2y)),
then we have (35)
S6,3 ([2x, 2y)) = S3,0 ([2x, 2y)) − S3,0 ([x, y)).
Furthermore, evidently, by (33) (36)
S6,1 ([2x, 2y)) = −S3,0 ([x, y))
and (37)
S6,2 ([2x, 2y)) = −S6,3 ([2x, 2y)).
According to (35) this means that (38)
S6,2 ([2x, 2y)) = S3,0 ([x, y)) − S3,0 ([2x, 2y)).
Furthermore, with help of (38) we have (39)
S3,1 ([x, y)) = S6,2 ([2x, 2y)) = S3,0 ([x, y)) − S3,0 ([2x, 2y)).
On the other hand, (40)
S3,1 ([x, y)) = S6,1 ([x, y)) + S6,4 ([x, y))
and consequently, by (36), (39) and (40) we have S6,4 ([2x, 2y)) = S3,1 ([2x, 2y)) − S6,1([2x, 2y)) = S3,1 ([2x, 2y)) + S3,0([x, y)) = (41)
= S3,0 ([2x, 2y)) − S3,0 ([4x, 4y)) + S3,0 ([x, y)).
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
8
Therefore, we conclude that (42)
S3,2 ([x, y)) = S3,0 ([x, y)) + S3,0 ([2x, 2y)) − S3,0 ([4x, 4y)).
From (39) and (42) it follows that (43) S3,0 ([x, y)) + S3,1 ([x, y)) + S3,2 ([x, y)) = 3S3,0 ([x, y)) − S3,0 ([4x, 4y)). Now note that, the left hand side of (43) equals to (44)
X
S1,0 ([x, y)) =
(−1)σ(n) =
X
0≤n δ3,0 N > n (2 + 2m + 2m−2 + 2m−4 + . . .)λ (54)
>
2 3
n
n
· 32
(2n +
2m+2 λ ) 3
>
2 2 32 = , 3 2nα 3
while in the case of (53)
δ3,0 (N) >
>
3
n−1 2
−3 2ηλ
m−1 2
3
n−1 2
·
−3
m−1 2
+3
2n + 2ηλ 2m+2 λ 3
+
m−1 2
2m+2 λ
· 1.069 . . .
3
3
2n + and using the Jensen inequality we have
m−1 2
1.069
2m+2 λ 3
·
(56)
inf
1≤σ(N )≤2,N ≥4
We consider several cases.
1
δ3,0 ([0, N)) =
2m+2 3
2n +
m−1
3 2 +λ δ3,0 (N) > min 1 − n−m , 1.069 m +1 32 3 2 2 1.069 (55) ≥ min > 0.49. , 3 31.5−λ Now we shall show that
>
!
2 = 0.48345 . . . 6λ
λ
2m+2 λ 3 ≥
11
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
12
a) σ(N) = 1. Taking into account that 4λ = 3 note that for even x, y (46) yields (57)
δ3,0 ([4x, 4y)) = δ3,0 ([x, y))
Consequently, we find for n ≥ 1 (58)
δ3,0 ([0, 2n )) =
(
δ3,0 ([0, 4); if n is even δ3,0 ([0, 2); if n is odd
=
(
2 , n is even 3 1 √ , n is odd 3
b) σ(N) = 2. Note that in the cases N = 2n + 2m where n and m are of the same parity according to (52) and (53) the more so, as (55) satisfies. b1) Let n be odd, m be even, n > m. Then S3,0 ([0, 2n + 2m )) = S3,0 ([0, 2n )) + S3,0 ([2n , 2n + 2m ))
(59)
If here m = 0, n ≥ 3 then according to Theorem 1 S3,0 ([0, 2n + 1)) = S3,0 ([0, 2n )) = 3
(60)
n−1 2
and 3
n−1 2
n−1
3 2 δ3,0 ([0, 2 + 1)) = n = n λ (2 + 1) 3 2 (1 + n
1 λ ) 2n
≥√
1 = 0.52589 . . . 3(1 + 18 )λ
Note that the case m = 0, n = 1 corresponds to N = 3 and now we do not consider this case (see (56)). Let now in (59) m ≥ 2, n ≥ 3. Then by Theorem 1 we have S3,0 ([0, 2n + 2m )) = 3
n−1 2
+3
m−2 2
and m−2
(61)
n−m+1
n−m+1
1 3 2 +1 3 2 (3 2 + 1) = · n−m δ3,0 ([0, 2 + 2 )) = λm n−m λ 2 (2 + 1) 3 (2 + 1)λ n
m
x+1
Put n − m = x ≥ 1. The function f (x) = 31 3(2x2+1)+1λ tends to √13 = 0.57735 . . . for x → ∞ and has the unique extremum in the point x = ln 3 = 3.8188 . . . We have: f (1) = 0.5582 . . . , f (3) = 0.5843 . . . , f (5) = ln 4−ln 3 0.5843 . . .. Thus, for odd n and even m we have
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
13
δ3,0 ([0, 2n + 2m )) ≥ 0.52589 . . .
(62)
b2) Let n be even, m be odd, n > m ≥ 1. Then according to (59) and Theorem 1 we have n
S3,0 ([0, 2n + 2m )) = 2 · 3 2 −1
and
n−m
n
(63)
2 3 2 2 · 32 − 1 = · n−m δ3,0 ([0, 2 + 2 )) = λm n−m λ 2 (2 + 1) 3 (2 + 1)λ n
m
x
2 2 Since the function g(x) = 32 (2x3+1) λ is increasing and tends to 3 while 2 2 g(1) = √3·3 λ = 6λ = 0.48345, then (56) is proved. Moreover, the infimum (56) attains on δ3,0 ([0, 2n + 2n−1 )), n = 2, 4, 6, . . . Finally, note that
δ3,0 ([0, 1)) = 1, δ3,0 ([0, 2)) =
1 1 = √ = 0.577 . . . , λ 2 3
1 δ3,0 ([0, 3)) = √ = 0.41868 . . . 3 From (56) and (64) it follows that
(64)
(65)
inf δ3,0 ([0, N)) =
N ≥1
1 = 0.41868 . . . 3λ
and 2 = 0.48345 . . . N →∞ 3λ such that lim inf N →∞ δ3,0 ([0, N)) is realized on a sequence
(66)
(67)
lim inf δ3,0 ([0, N)) =
Nn = 2n + 2n−1 , n = 2, 4, 6 . . .
At last, we obtain the exact lower bounds for S3,0 (N). For N ≥ 4 we have λ N = 0.48345 . . . N λ . S3,0 (N) ≥ 2 6 In particular, for m ≥ 2 we obtain:
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
S3,0 (3n) ≥ 2
n λ 2
14
2 = √ nλ = 1.1547005 . . . nλ 3
that corresponds to (18). In addition note that for all N ≥ 1 $ % λ N . . S3,0 (N) ≥ 2 6
(68)
5. Upper estimate Let the binary expansion of even N is (69)
N = 2n1 + 2n2 + . . . + 2nr , n1 > n2 > . . . > nr ≥ 1.
According to Theorem 1 and formulas (23)-(28) we easily find S3,0 (N) ≤ S3,0 (2n1 + 2n2 ) if 2 ≤ σ(N) ≤ 5.
(70)
Let now σ(N) ≥ 6. Then we have n4 −1 2
S3,0 (N) ≤ S3,0 (2n1 + 2n2 ) − 0 − 2 · 3 +3
n7 −1 2
+2·3
n8 −1 2
+3
n9 −1 2
−0+2·3
+2·3
n10 −1 2
n6 −1 2
+
.
Note that n6 ≤ n4 − 2, n7 ≤ n4 − 3, . . . Hence, S3,0 (N) ≤ S3,0 (2n1 + 2n2 ) − 0 − 2 · 3 +2 · 3
n4 −4 −1 2
+3
n4 −6 2
−2 · 3
+2·3
n4 −1 2
n4 −6 −1 2
2 3 + · 3
n4 −1 2
n4 −2 −1 2
+3
n4 −4 2
+ . . . = S3,0 (2n1 + 2n2 )−
n4 −1 2
2 3
+2·3
+
1 3n4 = · 9 23
n4 2 1 1 = S3,0 (2n1 + 2n2 ) − 3 2 ( − − ) < S3,0 (2n1 + 2n2 ). 3 3 6 Thus, if N is even then
(71)
+
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
15
δ3,0 (N) < δ3,0 (2n1 + 2n2 )
(72)
Let us show that (72) is correct as well for an odd N with σ(N − 1) ≥ 2 except of, probably, the case of σ(N − 1) = 2, N ≡ 1( mod 3). Indeed, if σ(N − 1) = 2 it follows directly from (31). If σ(N − 1) = 3 such that N = 2n1 + 2n2 + 2n3 + 1 by (31) also S3,0 (N) ≤ S3,0 (N − 1) and by (72) for N − 1 we have δ3,0 (N) ≤ δ3,0 (N − 1) < δ3,0 (2n1 + 2n2 ).
Finally, if σ(N − 1) = 4 and σ(N − 1) ≥ 5 then inequalities (70) and (71) are strict correspondingly and again we obtain (72) for an odd N as well. Let us find supσ(N )≤2 δ(N). By (58) supσ(N )=1,N ≥2 δ(N) = 32 . Note that (73)
δ3,0 (1) = 1
Moreover, we have already investigated δ(2n + 2m ) if n − m ≡ 1( mod 2) (see(61) and (63))and know that in this case δ(2n +2m ) ≤ 23 . Let us consider the remaining cases. a) Let n and m be odd, 1 ≤ m ≤ n − 2. Then by Theorem 1 S3,0 (2n + 2m ) = 3
n−1 2
+3
m−2 2
and thus n−1
m−2
n−m+1
1 3 2 +1 3 2 +3 2 = · . δ3,0 (2 + 2 ) = (2n + 2m )λ 3 (2n−m + 1)λ and coincide with (61) for n − m is even. Thus n
m
1 31.5 + 1 2 · = 0.5768 . . . < . λ 3 5 3 b) Let n and m be even, 0 ≤ m ≤ n − 2. In the case m = 0 by (31) and (58) we have δ3,0 (2n + 1) < 32 . Let now m ≥ 2. Then by Theorem 1 δ3,0 (2n + 2m ) ≤
n
m
n−m
2 · 3 2 −1 + 3 2 −1 1 2·3 2 +1 δ3,0 (2 + 2 ) = = · n−m . n m λ (2 + 2 ) 3 (2 + 1)λ n
m
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
16
x
2·3 2 +1 2 Put n − m = x ≥ 2. The function h(x) = 13 · (2 x +1)λ tends to 3 for x → ∞ ln 2 √ = 4.8188 . . . We and has the unique extremum in the point x = ln 2−ln 3 1 55 have h(2) = 0.6517 . . . , h(4) = 0.67069 . . . , h(6) = 3 · 65λ = 0.67072 . . . > 32 . Thus, according to (73)
sup δ3,0 (N) = 1 N ≥1
but N = 1 is isolated. If N ≥ 2 (in the case when N is odd and σ(N) = 3 55 - in the supposition N ≡ 0 or 2 (mod3)) the supremum is 31 65 λ = 0.67072 . . . In this case
In particular,
S3,0 (N) ≤ ⌊0.67072 . . . N λ ⌋. S3,0 (3N) ≤
55 3 λ λ ( ) N 3 65
that corresponds to (18). Finally, in the case of N ≡ 1(mod6) with σ(N) = 3 we have S3,0 (N) ≤ S3,0 (N − 1) + 1 ≤ ⌊0.67072 . . . (N − 1)λ ⌋ + 1 ≤ ⌈0.67072 . . . N λ ⌉. This estimate attains e.g. on N = 19 and 67. Now we conclude that 1 55 · 3 (65)λ for even n.
lim sup δ3,0 (N) = N →∞
an attains on a sequence 2n + 2n−6 Thus, we proved that for N ≥ 2
⌊0.483459 . . . N λ ⌋ ≤ S3,0 (N) ≤ ⌈0.67072 . . . N λ ⌉.
TWO ALGORITHMS FOR EVALUATION OF THE NEWMAN SUM
17
6. Fast computing algorithm In conclusion we give a fast computing algorithm for evaluation of S3,0 (N) which is based on formula (46) and some simple transformations. We obtain the following formula S3,0 (N) = 3S3,0 where
N 4
+ ν(N),
0, if N ≡ 0, 7, 8, 9, 16, 17, 18, 22, 23 (mod24) σ(N ) , if N ≡ 3, 4, 10, 12, 20 (mod24) (−1) σ(N )+1 ν(N) = (−1) , if N ≡ 1, 2, 5, 6, 11, 19, 21 (mod24) . σ(N ) 2(−1) , if N ≡ 15 (mod24) σ(N )+1 2(−1) , if N ≡ 13, 14 (mod24) Note that, by the definition (3), S3,0 (0) = 0. This algorithm is very suitable for sharp experiments but is not suitable for estimates. For example, let us show the concluding phase of the calculation of S3,0 (500000) by this algorithm: S3,0 (500000) = 6561S3,0 (7) − 2187(−1)σ(30) − −729(−1)σ(122) + 27(−1)σ(7812) − 9(−1)σ(31250) = = 19683 − 2187 + 729 + 27 + 9 = 18261. References [1] 1.J.Coquet, A summation formula related to the binary digits,Invent. Math.73 (1983), 107-115. [2] 2. A.O.Gelfond, Sur les nombers qui ont des proprietes additives et multiplicatives donnees, Acta Arithmetica XIII(1968), 259-265. [3] 3. D.J.Newman, On the number of binary digits in a multiple of three, Proc.Amer.Math.Soc.21 (1969),719-721. [4] 4. V.S.Shevelev, A conjecture on primes and a step towards justification, arXiv (math. NT math CO) 0706.0786. Departments of Mathematics, Ben-Gurion University of the Negev, BeerSheva 84105, Israel. e-mail:
[email protected]