On the counting function for the generalized Niven numbers Ryan Daileda, Jessica Jou, Robert Lemke-Oliver, Elizabeth Rossolimo, Enrique Treviño Abstract Given an integer base q 2 and a completely q-additive arithmetic function f taking integer values, we deduce an asymptotic epression for the counting function N f # {0 n < fn n} under a mild restriction on the values of f. When f s q, the base q sum of digits function, the integers counted by N f are the so-called base q Niven numbers, and our result provides a generalization of the asymptotic known in that case. Introduction Let q 2 be a fied integer and let f be an arbitrary comple-valued function defined on the set of nonnegative integers. We say that f is completely q-additive if faq j + b fa + fb for all nonnegative integers a, b, j satisfying b < q j. Given a nonnegative integer n, there eists a unique sequence a j n j N {0,,..., q } N so that n a j nq j. j0 2000 Mathematics Subject Classification: A25, A63, K65. The second, third, fourth and fifth authors received support from the National Science Foundation under grant DMS-0648390.
2 Ryan C. Daileda et al. The right hand side of epression will be called the base q epansion of n. Using the base q epansion, we find that the function f is completely q-additive if and only if f0 0 and fn fa j n. j It follows that a completely q-additive function is completely determined by its values on the set {0,,..., q }. The prototypical eample of a completely q-additive function is the base q sum of digits function s q, which is defined by s q n a j n. j0 A q-niven number is a positive integer n that is divisible by s q n. The question of the average distribution of the q-niven numbers can be answered by studying the counting function N q #{0 n < : s q n n}, a task which has been undertaken by several authors see, for eample, the papers of Cooper and Kennedy [, 2, 3, 4] or De Koninck and Doyon [5]. The best known result is the asymptotic formula N q c q + o log, where c q 2 log q q 2 q j, q, which was proven only recently by De Koninck, Doyon and Kátai [6], and independently by Mauduit, Pomerance and Sárközy [8]. Given an arbitrary non-zero, integer-valued, completely q additive function f, we define an f-niven number to be a positive integer n that is divisible by fn. In the final section of [6] it is suggested that the techniques used therein could be applied to derive an asymptotic epression for the counting function of the f-niven numbers, N f # {0 n < fn n}. It is the goal of this paper to show that, under an additional mild restriction on f, this is indeed the case. Our main result is the following. Theorem. Let f be a non-zero, integer-valued, completely q-additive function and set j µ q fj, σ 2 q fj 2 µ 2, q q j0 j0
The counting function for the generalized Niven numbers 3 F f, f2,..., fq and Assume F, q. d gcd {rfs sfr r, s {, 2,..., q }}. i If µ 0 then for any ɛ 0, /2 where N f c f c f log q µ log + O log 3 2 ɛ q j, q, d. q j The implied constant depends only on f and ɛ. ii If µ 0 then N f c f log log log 2 + O log 2 where log q c f 2πσ 2 2 q q j, q, d. j The implied constant depends only on f. The hypothesis F, q is the restriction alluded to above. It is technical in nature and will not be utilized until the end of Section 4.. There we will see that it allows us to reduce the study of the distribution of the values of f when it s argument is restricted to specified congruence classes to the study of how the values themselves are distributed in congruence classes. While this hypothesis prevents Theorem from being as general as one might hope, it is worth noting that it is not terribly restrictive either, especially when q is large. Fiing q 3, if we choose integer values for f, f2,..., fq uniformly randomly in the interval [ n, n], then f is completely determined and the probability that F is ζq +o, as n. Since ζq tends to as q tends to infinity, we see that for large q almost all completely q-additive functions f satisfy F, q. It would still be of interest, however, to obtain the analogue of Theorem in the case that F, q >. Most of the proof of Theorem is a straightforward generalization of the methods used in [6] and it is the intent of this paper to indicate where
4 Ryan C. Daileda et al. significant and perhaps non-obvious modifications to that work must be made. The first notable change is the introduction and use of the quantities d and F. As d 0 and F when f s q these quantities play no role in earlier work. Finally, in order to shorten the presentation, we have attempted to unify the µ 0 and µ 0 cases for as long as possible. The result is a slightly different approach in the µ 0 case than appears in [6]. The final steps when µ 0 are entirely new. 2 Notation We denote by Z, Z +, Z + 0, R and C the sets of integers, positive integers, nonnegative integers, real numbers and comple numbers, respectively. For the remainder of this paper, we fi an integer q 2 and a non-zero completely q additive function f : Z + 0 Z. The variable will always be assumed real and positive and n will always be an integer. Following [6] we set A k, l, t #{0 n < n l mod k and fn t}, a t #{0 n < fn t}. As usual, we use the notation F OG or F G to mean that there is a constant C so that for all sufficiently large, F CG. The constant C and the size of are allowed to depend on f and hence on q, but on no other quantity unless specified. 3 Preliminary Lemmas For real y we define y to be the distance from y to the nearest integer. Lemma. Let M ma j q fj. Let s, k Z + with s, k and suppose that there is a pair j, j 2 {0,,..., q } so that k j fj 2 j 2 fj. Then for any ξ R ma js 0 j q fjξ + k 2Mk. 2 Proof. We first claim that the maimum in question is at least positive. To see this we argue by contradiction and assume that fjξ + js/k 0 for 0 j q. Then fjξ + js/k n j Z for each j. Solving for ξ and equating the resulting epressions, we find that if fj, fj 2 0 then kn j fj 2 n j2 fj sj fj 2 j 2 fj. 3
The counting function for the generalized Niven numbers 5 Since s, k, this implies that k j fj 2 j 2 fj, which is ecluded by assumption. Since this same condition is trivially verified if fj 0 or fj 2 0, we have a contradiction in any case. To prove the lemma we again argue by contradiction. Let us remark that for any k > 0 k j fj 2 j 2 fj s k fj fj 2 ξ + j fj 2 s fj fj 2 ξ + j 2fj s k k fj 2 fj ξ + j s + k fj fj 2 ξ + j 2s. k If we assume now that 2 is not verified, then and similarly fj M < 2k ma 0 j q fjξ + js/k 2 fj 2 ξ + j 2 s/k fj 2 < 2 fj ξ + j s/k. Therefore, by properties of, k fj 2 fj ξ + j s k + fj fj 2ξ + j 2s k 2M ma js 0 j q fjξ + k < 2M 2Mk k which is a contradiction. It is proven in [7] that if z, z 2,..., z q C satisfy z j for j, 2,..., q. then q + z j ma q 2q Re z j. 4 j q j Since for real y we have y 2 cos2πy and + y e y, the net lemma is an immediate consequence.
6 Ryan C. Daileda et al. Lemma 2. Let ey e 2πiy. There is a positive constant c c f so that for any ξ, r R q e fjξ + rj q ep c ma fjξ + rj 2. 5 j q j0 4 The distribution of the values of f 4. Argument restricted to a congruence class Let k Z +, l Z + 0 and t Z. Our first goal in this section is to relate A k, l, t to the function a t through a series of reductions on the modulus k. The first three reductions are proven eactly as in [6], substituting our Lemma 2 for their Lemma 3. We state them for the convenience of the reader. Reduction. Write k k k 2 where k is the largest divisor of k so that k, q. Then the primes dividing k 2 also divide q and we let h be the smallest positive integer so that k 2 divides q h. Since k divides k q h, the congruence class l mod k is the union of classes l j mod k q h, j,..., q h /k 2. For each j write where 0 l j < q h. Then A k, l, t q h /k 2 j l j l j + q h l j 2 A l j q h k, l j 2, t fl j. Since k, q, we are led to the net reduction. Reduction 2. Suppose that k, q. Let k k k 2 where k is the largest divisor of k so that k, q. Then there is a positive constant c 3 c 3 f so that A k, l, t A k 2, l, t + O c 3 log 2k. k Before moving to the net reduction, we note that the primes dividing k 2 must also divide q. Reduction 3. Suppose that the prime divisors of k also divide q. Then there is a positive constant c 4 c 4 f so that A k, l, t k, q A k, q, l, t + O c 4 log 2k. k
The counting function for the generalized Niven numbers 7 We have therefore reduced to the case in which the modulus is a divisor of q. Reduction 4. We now come to the first new reduction. The proof closely follows that of Reductions 2 and 3 of [6], substituting our Lemma for their Lemma and our Lemma 2 for their Lemma 3. We therefore choose to omit it. Suppose that k q and let d denote the greatest common divisor of j fj 2 j 2 fj for j, j 2 {0,,..., q }. Then there is a positive constant c 5 c 5 f so that A k, l, t k, d k A k, d, l, t + O c 5. We note that in the case f s q we have d 0, making this reduction unnecessary. As such, it has no analogue in [6]. Reduction 5. Suppose that k divides q, d. Then q j mod k for all j and j fj 2 j 2 fj mod k for all 0 j, j 2 q. From this and the complete q-additivity of f it follows that mfn nfm mod k for all m, n Z + 0. Let F f, f2,..., fq and suppose further that F, q. Since the values of f are linear combinations of f, f2,..., fq with nonnegative integer coefficients, the condition F, q implies that we can find an m Z + so that fm, q. Therefore if n Z + 0 satisfies fn t we have mt mfn nfm mod k and it follows that A k, l, t { a t if mt lfm mod k, 0 otherwise. This is the analogue of the final reduction in section 4.5 of [6]. 4.2 Unrestricted argument We now turn to the distribution of the values of f when its argument is free to take on any value. We let µ and σ denote the mean and standard deviation of f on the set D {0,,..., q } of base q digits. That is, We also set µ q fj, σ 2 q fj 2 µ 2. q q j0 N j0 log log q where y is the greatest integer not eceeding y.
8 Ryan C. Daileda et al. Following [], we view D as a probability space in which each element is assigned a measure of /q. We use the digits of the base q epansion to identify the set of nonnegative integers n strictly less than q N N Z + with the product space D N. In this way f can be viewed as the random variable on D N obtained by summing together N independent copies of f acting on D alone. In this setting, if we apply Theorem 5, Chapter III of [9] we immediately obtain the net lemma. Lemma 3. Let F : D R have average value 0. If F is etended to a completely q-additive function on Z + 0, then there is a constant C > 0, depending only on q and F, so that for N Z + we have and for all 0 k N/C. #{0 n < q N F n k} q N e Ck2 /N #{0 n < q N F n k} q N e Ck2 /N Proposition. Let ɛ 0, /2 and set I [µn N /2+ɛ, µn + N /2+ɛ ]. Then #{0 n < fn I} log 2 the implied constant depending only on f and ɛ. Proof. For C > 0, as N Z + tends to infinity eventually 0 N /2+ɛ ± µ N + /C, so that Lemma 3 applied to the function F f µ gives and # { 0 n < q N+ fn µn N /2+ɛ } q N e c N 2ɛ # { 0 n < q N+ fn µn N /2+ɛ } q N e c 2N 2ɛ for some positive constants c and c 2. Setting c min{c, c 2 } these inequalities together give # { 0 < q N+ fn µn N /2+ɛ } q N e cn 2ɛ. 6 The stated result now follows since # {0 n < fn I } # { 0 n < q N+ fn µn N /2+ɛ q N cn 2ɛ e log. 2 }
The counting function for the generalized Niven numbers 9 We remark that if ɛ > 0, Lemma 4 of [8], when translated into our present notation, immediately implies that { #{0 n < s q n I} ma ep 6 } q 2 N 2ɛ, c log log 7 for some c > 0. Since the right hand side of 7 is O, this provides log 2 a proof of Proposition in the case f s q. In fact, if in the proof of Proposition we replace N /2+ɛ by N /2 λ, where λ on /2, we obtain a more general result that is very similar to Lemma 4 of [8]. As observed in [6] in the case f s q, Theorem 6, Chapter VII of [9] can be used to obtain the following result. Proposition 2. If f, f2,..., fq then uniformly for t Z we have a t t σ µn ϕ N σ + O N N where ϕy 2π /2 e y2 /2. The implied constant depends only on f. Corollary. If F f, f2,..., fq then a t F t σ µn ϕ N σ N when t 0 mod F and a t 0 otherwise. + O N Proof. Apply the proposition to the function g f/f. 5 Proof of Theorem It suffices to consider the case in which µ 0, since N f N f. Fiing ɛ 0, /2, according to Proposition we have N f t 0 mod F A, 0, t + O. 8 log 2 As in Section 5 of [6], one can show that Reductions through 5 together with the corollary to Proposition 2 yield A, 0, t t, q, d a t + O log N tn 9
0 Ryan C. Daileda et al. uniformly for nonzero t I. Since t, q, d depends only on the residue of t mod q, substitution of 9 into 8 yields q N f j, q, d j t 0 t 0 mod F t j mod q a t log N + O E N 0 where E { N ɛ /2 if µ > 0, log N if µ 0. Lemma 4. For j, 2,..., q we have t 0 t 0 mod F t j mod q a t q t 0 t 0 mod F a t + O E 2 N where E 2 { N ɛ /2 if µ > 0, N /2 if µ 0. Proof. Since we have assumed F, q, for each j, 2,..., q there is a unique b j mod F q so that the two simultaneous congruences t 0 mod F and t j mod q are equivalent to the single congruence t b j mod F q. The corollary to Proposition 2 implies that for t, k 0 mod F we have a t + k t + k a t + O log + t 2 log /2 when t + k 0, the implied constant depending only on f and k.
The counting function for the generalized Niven numbers When µ > 0 we therefore have t 0 t 0 mod F t j mod q a t t b j q mod F q t b j +O q N 3/2 ɛ +O a t t q 2 k0 mod F q s I s 0 mod F N 3/2 ɛ, a s s a t + kf t + kf + O s J s 0 mod F a s s where J is the set of integers with distance at most qf from the endpoints of I. Since a s /N /2, the sum over J contributes no more than the second error term, proving the lemma in this case. When µ 0 we may carry through the same analysis, being careful in the second step to omit from the summation the single value of t for which t + kf 0. This introduces an error of size O/N /2, which is consistent with the statement of the lemma. Combining Lemma 4 with equation 0 we can now complete the proof. When µ > 0 we have N f q j, q, d q j t 0 mod F q j, q, d µn q j log log +O log 3/2 ɛ a t t t 0 mod F log N + O a t N 3/2 ɛ
2 Ryan C. Daileda et al. log q q j, q, d µ log q j log log +O log 3/2 ɛ log q µ q q j, q, d j t 0 mod F a t log log log + O, log 3/2 ɛ where in the final line we have used Proposition to replace a t with + O/log 2. Since ɛ 0, /2 was arbitrary, we may discard the log log term in the error, giving the stated result. When µ 0 we have q N f j, q, d q j t 0 t 0 mod F a t + O. 2 N /2 Set ɛ /4 for convenience. Writing t F s and using the corollary to Proposition 2 we obtain t 0 t 0 mod F Now a t 2 σ N s N 3/4 /F sf s ϕ σ + O N log N N. 3 s N 3/4 /F sf s ϕ σ N N 3/4 /F N 2π sf s ϕ σ ds + O N /4 /σ 2 F/σ 2N e u2 u du + O e u2 du + O 2π F/σ 2N u du + O 2π F/σ 2N u 2 2π log N + O 2 log log + O. 2π
The counting function for the generalized Niven numbers 3 Returning to equations 2 and 3 we find that N f q j, q, d 2πσ 2 /2 q j /2 q log q j, q, d 2πσ 2 q +O log /2 which concludes the proof. j log log N /2 log log log /2 + O N /2 References [] Cooper, C. N.; Kennedy, R. E., On the natural density of the Niven numbers, College Math. J. 5 984, 309 32. [2] Cooper, C. N.; Kennedy, R. E., On an asymptotic formula for the Niven numbers, Internat. J. Math. Sci. 8 985, 537 543. [3] Cooper, C. N.; Kennedy, R. E., A partial asymptotic formula for the Niven numbers, Fibonacci Quart. 26 988, 63 68. [4] Cooper, C. N.; Kennedy, R. E., Chebyshev s inequality and natural density, Amer. Math. Monthly 96 989, 8 24. [5] De Koninck, J. M.; Doyon, N., On the number of Niven numbers up to, Fibonacci Quart. 4 5 2003, 43 440. [6] De Koninck, J.-M.; Doyon, N.; Kátai, I., On the counting function for the Niven numbers, Acta Arithmetica 06 3 2003, 265 275. [7] Delange, H., Sur les fonctions q-additives ou q-multiplicatives, Acta Arithmetica 2 972, 285 298. [8] Mauduit, C.; Pomerance, C.; Sárközy, A., On the distribution in residue classes of integers with a fied sum of digits, Ramanujan J. 9-2 2005, 45 62. [9] Petrov, V. V., Sums of Independent Random Variables, Ergebnisse der Mathematik und ihrer Grenzgebiete 82, Springer, 975.
4 Ryan C. Daileda et al. Mathematics Department, Trinity University, One Trinity Place, San Antonio, TX 7822-7200 E-mail: rdaileda@trinity.edu Penn State University Mathematics Department, University Park, State College, PA 6802 E-mail: jjj73@psu.edu Department of Mathematics, Rose-Hulman Institute of Technology, 5000 Wabash Avenue, Terre Haute, IN 47803 E-mail: lemkeorj@rose-hulman.edu Department of Mathematics and Statistics, Lederle Graduate Research Tower, Bo 3455, University of Massachusetts Amherst, Amherst, MA 0003-9305 E-mail: erossoli@student.umass.edu Department of Mathematics, 688 Kemeny Hall, Dartmouth College, Hanover, NH 03755-355 E-mail: enrique.trevino@dartmouth.edu