Let $A$ be the set of numbers whose sum of digits is prime (<http://oeis.org/A028834>).


I would like to know if $A$ has zero natural density, that is, if $$\lim\_{n \to +\infty} \frac{A(n)}{n} = 0,$$ where $A(n)$ is the number of elements of $A$ which are less than or equal to $n$.


Numerical experiments seems to indicate that $A(n) / n$ goes to zero, but very slowly.


$$\begin{matrix}n & A(n)/n \\ 
10 & 0.400 \\
10^2 & 0.370 \\
10^3 & 0.340 \\
10^4 & 0.301 \\
10^5 & 0.267 \\
10^6 & 0.249
\end{matrix}$$


[Graph of $A(n) / n$](https://i.stack.imgur.com/pidyd.jpg)


Thanks



Density of the set of numbers whose sum of digits is prime
Yes, $A(n)$ has zero natural density. It suffices to prove this for $n$ which is a power of $10$.
and it is possible to make this more precise. To see this, first let $n=10^k$ and note that for $X$ chosen uniformly among integers in $[0,n-1]$, the sum $S(X)$ of base 10 digits is the sum of $k$ i.i.d. random variables uniformly distributed among integers in $[0,9]$. By the Local Central Limit Theorem for i.i.d. lattice variables (see, e.g. [1], [2] for a precise formulation) the law of $S(X)$ is very well approximated by a normal density of standard deviation of order $\sqrt{k}$ centered at $4.5k$. Now use the elementary fact that for any $f(k) \to \infty$ and any $B>1$, the asymptotic frequency of primes in $[k, k+f(k)]$ is at most $\prod\_{p \le B} (1-1/p) $. This product over primes tends to 0 as $B \to \infty$, proving the asymptotic density of $A(n)$ is zero.


Remark: Together with the PNT [3] one gets the prediction
$$A(n)/n=\frac{1+o(1)}{\log \log(n)} \,,(\*) $$
but the PNT does not imply this, one needs to use more precise information on the number of primes in short intervals, a topic of much research, see e.g. [4], [5] and the references therein. In particular, the sieve estimate of Montgomery-Vaughn (See Cor 3.4 in [4])
yields
$$A(n)/n\le \frac{4+o(1)}{\log \log(n)} \,.$$


[1] <https://encyclopediaofmath.org/wiki/Local_limit_theorems>


[2] V.V. Petrov, "Sums of independent random variables" , Springer (1975) (Translated from Russian)


[3] <https://en.wikipedia.org/wiki/Prime_number_theorem>


[4] Montgomery, Hugh L., and Robert C. Vaughan. Multiplicative number theory I: Classical theory. Vol. 97. Cambridge university press, 2007.


[5] [How many primes can there be in a short interval?](https://mathoverflow.net/questions/235463/how-many-primes-can-there-be-in-a-short-interval)


