# What are non-trivial facts about the sequence of averages of digits of an integer sequence?

Write $A_{10}(k)$ for the average of the base-10 digits of a positive integer $k$:

$A_{10}(k):=\tfrac{1}{L+1}(d_0+\dots+d_L)$, where $k=\sum_{i=0}^L d_i 10^i$ with $d_i\in\{0,\dots,9\}$

I wonder if there is a sequence $\{a_n\}$ of positive integers for which any non-obvious facts about the behaviour of the digit-average sequence $\{A_{10}(a_n)\}\subset[0,9]$ are known?

For example, do we know that $\liminf_{n\rightarrow\infty} A_{10}(2^n)>0$ ?

• It's not known whether all sufficiently large powers of 2 have a 7 in their decimal expansion (it is known that almost all sufficiently large powers of 2 have a 7 in their decimal expansion). For me, this strongly suggests that nothing is known about the example question. – Anthony Quas May 24 '17 at 20:32
• @AnthonyQuas Are you sure? The law of the first digit in the powers of $2$ is given by the Benford law. As far as I remember, the laws of the other digits are also known, probably close to uniform as the position shifts, so this should allow to answer the last question by the positive. – coudy May 24 '17 at 20:36
• @coudy: The analogs of Benford's law that I know apply to digits a fixed number of steps from the left. They don't seem strong enough. Can you prove that the distribution of the middle digit approaches a uniform distribution? – Douglas Zare May 24 '17 at 21:20
• I am sure that the question of whether every sufficiently large power of 2 has a 7 in its decimal expansion is a known hard problem. It is possible, but unlikely, that it has been recently solved. The problem was Benford-type laws is that if you fix a position, you can say the something about the distribution of the $i$th digit. But if you want to talk about independence, you have to go a long way before the first $i$ digits become independent. By that time, the proportion of digits covered by the independence statement is negligible. – Anthony Quas May 25 '17 at 0:51
• Thanks for the feedback, so the example question seems to be out of reach. Now I wonder what upper bound we can get for the quantity in question. – süppli May 30 '17 at 18:45

Iekata Shiokawa, On the sum of digits of prime numbers, Proc Japan Acad 50 (1974) 551-554, proved $$\sum_{p\le x}A_r(p)={r-1\over2}{x\over\log r}+O\left(x\left({\log\log x\over\log x}\right)^{1/2}\right)$$ The sum is over the primes up to $x$, and $r$ is the base.
• That must be $x/\log x$ in the main term; not $x/\log r$. Somehow this is just saying that the primes have the same average digit sum as the integers in the corresponding range. Given that the primes are really quite dense, this is not far from trivial IMO. – Anthony Quas May 25 '17 at 16:41
• @Anthony, that was my first reaction to the $\log r$, too. But we're not counting primes, we're adding digits, and the number of digits in $x$ is $\log_rx=(\log x)/(\log r)$, and that's more-or-less why there's a $\log r$ there instead of a $\log x$. If it were a $\log x$, then the error term would exceed the main term. Have a look at the paper, and see if you don't agree. – Gerry Myerson May 25 '17 at 22:50
• So the paper is summing a different quantity. It's summing $\alpha_r(p)$, which is the digit sum of $p$, not the digit average of $p$. The main term now makes sense, because the number of digits is $\log x/\log r$, so the sum of the $\alpha_r(p)$ should be something like $\log x/\log r$ times greater than the the sum of the $A_r(p)$; and the sum of the $A_r(p)$ should be something like $((r-1)/2) x/\log x$ as in my previous comment. – Anthony Quas May 26 '17 at 15:54