2 3 47 6 23 Journal of Integer Sequences, Vol. 5 (202), Article 2.2.2 Counting Primes whose Sum of Digits is Prime Glyn Harman Department of Mathematics Royal Holloway, University of London Egham Surrey TW20 0EX United Kingdom g.harman@rhul.ac.uk Astract Motivated y recent work of Drmota, Mauduit and Rivat, we discuss the possiility of counting the numer of primes up to x whose sum of digits is also prime. We show that, although this is not possile unless we assume a hypothesis on the distriution of primes stronger than what is implied y the Riemann hypothesis, we can estalish a Mertens-type result. That is, we otain a formula for the numer of such primes p up to x weighted with a factor /p. Indeed, we can iterate the method and count primes with the sum of digits a prime whose sum of digits is a prime, and so on. Introduction Thanks to the revolutionary work of Mauduit and Rivat [7], in particular as developed in [2], our knowledge of the distriution of primes with constraints on their sum of digits has undergone a sustantial expansion in recent years. The question of counting the numer of primes up to x, whose sum of digits in ase is also prime, would have een considered far too difficult ten years ago in view of the difficulty in restricting the sum of digits function when its variale is prime. In this paper we discuss this question, showing that it is still impossily difficult at present, ut this is now a result of our lack of knowledge concerning the distriution of primes in short intervals, and no longer caused y the prolems of restricting the sum of digits function. However, we are ale to prove a Mertens-type result on counting
primes whose sum of digits is prime. Throughout this paper the letters p and q are reserved for prime variales. In 874 Mertens proved that p = log log X + A + O((log x) ), for a certain constant A (see [, p. 56]). In this paper we will otain analogues of this result for primes whose sum of digits written in ase ( 2) are also prime. For revity we shall write this set as P. If r r n = a k k, 0 a k, then we put σ (n) = k=0 for the sum of digits function in ase. In fact we shall e ale to iterate our working and estalish Mertens-type theorems for primes elonging to sets defined as follows: P () = P, P (j) = {p P : σ (p) P (j ) }, j = 2, 3... We write log x for the logarithm to ase, log x for the natural logarithm, and define L j (x) inductively y k=0 L (x) = max(, log x), L j (x) = L (L j (x)) for j 2. Our starting point will e a remarkale theorem of Drmota, Mauduit and Rivat [2]. Before stating the result precisely we need the following notation: s = 2 2, µ = 2 ( ), S(k,x) = {p x : σ (p) = k}. As usual we write φ(n) for Euler s totient function, and π(x) for the numer of primes up to x. We recall the prime numer theorem in the form π(x) = x ( ) x log x + O. () (log x) 2 Theorem (Drmota/Mauduit/Rivat). We have, uniformly for all integers k 0 with (k, ) =, S(k,x) = ( π(x) exp ( (k µ ) log x) 2 ( ) ) + O (log x) 2 +ǫ, (2) φ( ) 2πs log x 2s log x where ǫ > 0 is aritrary ut fixed. Since σ (p) p (mod ), for all ut the finitely many primes p satisfying (p, ) > we have (σ (p), ) =, and this leads to the ( )/φ( ) factor appearing frequently. From the aove result we can deduce some very interesting corollaries. Clearly, (2) shows that every sufficiently large integer is the sum of digits of a prime numer. So, in particular, there are infinitely many primes whose sum of digits is also prime. Also, every sufficiently large prime is the sum of digits of another prime which in turn is the sum of digits of another prime, and so on. We use Theorem to otain a Mertens-type result as follows. 2 a k
Theorem 2. Let 2 e an integer and X 2. Then we have p P p = φ( ) L 3(X) + O(). (3) In fact we shall use Theorem 2 as the first step in an inductive argument to estalish the following more general result for the sets P (j). Theorem 3. Let,j 2 e integers and X 2. Then we have ( ) j p = L j+2(x) + O(). (4) φ( ) p P (j) As a final application of Theorem we leave the following for the reader to prove. Theorem 4. Write P for the set of primes in P which have a prime numer of digits. Then L 2 (p) = p φ( ) L 3(X) + O(). p P 2 The prolem of the unweighted sum In this section we riefly consider the sum π(x) =. p P First we note the following result of Kátai [5]. Lemma 5. For every positive integer k we have σ (p) µ log x k k x(log x) k/2. p<x Now, even assuming the Riemann hypothesis and the pair correlation conjecture [3] we cannot prove that every interval I y = [y y 2(log y) 3,y+y 2(log y) 3] contains a prime numer. Suppose that I y contains no primes, and choose X so that y = µ log X. Then Theorem cannot supply an asymptotic formula for π (X), and y Lemma 5 with k = 3A π (X) A X XL (X)(L 2 (X)) A for every positive integer A. This shows that no asymptotic formula is possile unless a stronger result than can e otained on the Riemann hypothesis is assumed, for clearly π (X) should e of size X(L (X)L 2 (X)). We state here a hypothetical result to illustrate what we mean. 3
Theorem 6. Suppose that there exists a positive function f(x) 0 such that for all large x every interval of the form [x,x + x 2f(x)] contains f(x)x 2( + o())(log x) primes. Then π(x) X φ( ) L (X)L 2 (X). (5) The proof of this result is straightforward. By Lemma 5 we need only count primes whose sum of digits is q with q µ log x < (log x) 2 3. (6) Applying Theorem we need to estimate exp ( (q µ ) log x) 2. 2s log x (6) Breaking the summation range into shorter ranges of the form [y,y + y 2f(y)] and then comparing a sum with an integral we otain + o() ( ) t 2 exp dt = + o() 2s π log log(µ log x) 2s log x log(µ log x) x, which quickly estalishes the result. We remark that the hypothesis of Theorem 6 is almost always true unconditionally in the following sense. The method of Heath-Brown [4] shows that, given ǫ > 0, there exists η > 0 such that for all integers y [Y, 2Y ), with at most Y 3 4 +ǫ exceptions, every suinterval [z,z + z 2 η ] of [y Y 2 +ǫ,y + Y 2 +ǫ ] contains z 2 η ( + O((log z) ))(log z) primes. For these non-exceptional y and with X chosen to satisfy y = µ log X we then have (5). Indeed, we can otain the expected asymptotic formula for X on quite long ranges. We note that we are unale to use the stronger results otainale using a sieve method [6] since we require an asymptotic formula for the numer of primes in an interval rather than upper or lower ounds. 3 Proof of Theorem 2 Lemma 5, together with (2), shows that σ (p) is concentrated near its mean value µ log p, and so enales us to restrict our attention to certain p P with negligile error. We write ( ) M(m) = exp (log )m 7 8, µ(m) = µ m 7 8, ǫ(m) = M(m + ) M(m), δ(m) = (m + ) 7 7 8 m 8, M(m) and put M(m) = [M(m), M(m + )). We note for future reference that ( ) ( ( )) ǫ(m) = O m 8 and ǫ(m) = δ(m) log + O m 8. (7) 4
Let V e the largest integer with M(V ) < X. Also, write P(m) = {p P : σ (p) = q, q µ(m) < q 2 3 }. We remark that the exponents 7 8, 2 3 aove are chosen as convenient fixed numers etween 2 and (which must satisfy certain inequalities to enale certain sums to converge later) and have no other special significance. From Lemma 5 we can deduce that converges. Hence Now write Q = log X. Then S(X) := p P S(X) = q<q m= p M(m) p P,p/ P(m) p = m V m V q µ(m) <q 2 3 M(m) M(m) p p M(m) p P(m) p M(m) σ (p)=q + O(). + O(). After applications of Theorem with ǫ = /4 and using () this ecomes ( ) ) ǫ(m) (q µ(m))2 exp ( + O(m 4 ). (8) φ( ) q<q m V (log )m 7 8 2πs m 7 2s 8 m 7 8 q µ(m) <q 2 3 Now the O(m 4) term in the aove leads to an error (using m = (q/µ ) 8 7 + O(q 8 7 3)) q<q q 8 7 3 q 7 q q 2 q 2 7 = O(), and so we can concentrate on the main term in (8). By (7) we can replace ǫ(m) with δ(m) log and only incur an error which is O(m 8) times the main term. We can ignore this error as it will prove to e negligile. By using m 7 8 = q/µ + O(q 2 3) we can reduce the sum to (µ /q) 3 2 Σq + O(), φ( ) 2πs with Σ q = m V q µ(m) <q 2 3 q<q δ(m) exp ( µ ) (q µ(m)) 2. 2s q 5
We can identify this as a Riemann sum of an integral and so otain We have thus shown that as required to complete the proof. q/µ +q 2 3 Σ q = exp ( µ ) (q µ x) 2 dx + O() q/µ q 2 3 2s q 2s qπ = + O(). µ 3 2 S(X) = φ( ) q + O() = φ( ) L 3(X) + O() (9) q<q 4 Proof of Theorem 3 We prove Theorem 3 y induction; Theorem 2 is the case j =. Now assume that the case j has een proved. If we follow the working in 3, then in place of (9) we otain p P (j+) p = φ( ) p<y p P (j) p + O() where Y = log X. By the inductive hypothesis we therefore have p P (j+) as required to complete the proof. ( ) j+ p = L j+3(x) + O() φ( ) 5 Acknowledgement I would like to thank the referee for his suggestions and Christian Elsholtz whose e-mail conversation sparked my interest in this topic. References [] H. Davenport, Multiplicative Numer Theory, 2nd edition, revised y H. L. Montgomery, Springer, 980. [2] M. Drmota, C. Mauduit and J. Rivat, Primes with an average sum of digits, Compositio Math. 45 (2009), 27 292. 6
[3] D. Goldston and D. R. Heath-Brown, A note on the difference etween consecutive primes, Math. Ann. 266 (984), 37 320. [4] D. R. Heath-Brown, The differences etween consecutive primes, III, J. London Math. Soc. (2), 20, 77 78. [5] I. Kátai, On the sum of digits of primes, Acta Math. Acad. Sci. Hungar. 30 (977), 69 73. [6] K. Matomäki, Large differences etween consecutive primes, Quart. J. Math. 58 (2007), 489 57. [7] C. Mauduit and J. Rivat, Sur un prolème de Gelfond: la somme des chiffres des nomres premiers, Ann. of Math. 7 (200), 59 646. 200 Mathematics Suject Classification: Primary A63; Secondary N05, N60. Keywords: prime numer, sum of digits, Mertens theorem. (Concerned with sequences A046704, A070027, and A0998.) Received Septemer 6 20; revised version received Decemer 29 20. Pulished in Journal of Integer Sequences, Decemer 30 20. Return to Journal of Integer Sequences home page. 7