TITLE: Existence of relative Dirichlet density of primes starting with 1
QUESTION [12 upvotes]: This question is a duplicate of an existing MO question, but that other MO question has an accepted answer that does not actually answer the question, and I'm not sure how to fix that other than by re-asking the question.
On page 76 of Serre's book A Course in Arithmetic, he writes:

[T]here exist sets having an analytic density but no natural density.  It is the case, for example, of the set $P^1$ of prime numbers whose first digit (in the decimal system, say) is equal to 1.  One sees easily, using the prime number theorem, that $P^1$ does not have a natural density and on the other hand Bombieri has shown me a proof that the analytic density of $P^1$ exists (it is equal to $\log_{10}2 = 0.301029995\ldots$).

There is a slight misstatement here because literally speaking, $P^1$ has natural density zero, but clearly the intent is to speak of the relative density of $P^1$ inside the set $P$ of all primes.  In other words, Bombieri's result is a kind of "Benford's law for primes":
$$\lim_{s\to1} {\sum_{m\in P_1} m^{-s} \over \sum_{p\in P} p^{-s}} = \log_{10}2.$$
My question is, how does one prove that the above limit (which goes by various names—relative analytic density, relative Dirichlet density, relative zeta density) exists?  Serre does not say anything about this.
The accepted answer to the duplicate MO question cites two papers, one by Cohen and Katz, and one by Raimi.  But the paper by Cohen and Katz simply restates what Serre says without giving a proof.  The paper by Raimi cites a paper by R. E. Whitney (Initial digits for the sequence of primes, Amer. Math. Monthly 79 (1972), 150–152) but Whitney's paper considers logarithmic density rather than Dirichlet density:
$$\lim_{N\to\infty} {\sum_{m\in P_1, m\le N} 1/m \over \sum_{p\in P, p\le N} 1/p}.$$
It's not clear to me that this implies Bombieri's result.
In a comment to a now-deleted MO question, KConrad suggested looking in the book Prime Numbers by Ellison and Ellison, but I did not find the answer there either.

REPLY [6 votes]: The answer by so-called friend Don indicates why the existence of logarithmic density implies the existence of Dirichlet density, with the same value. Below is an argument explaining why the set of primes with a specified initial digit has a logarithmic density  (of Benford type), and thus a Dirichlet density. In my experience, the number of times authors cite Serre on this point is much greater than the number of references that provide an actual proof, so another write-up of a proof is probably helpful.
The paper by R. E. Whitney mentioned in the OP uses the Mertens formula $\sum_{p \leq x} 1/p = \log \log x + M + O(1/(\log x)^2)$, where the $O$-term is stronger than the remainder term
typically found in treatments of this estimate, which is $O(1/(\log x))$. The argument below avoids this. We start with a useful technical lemma that will be applied a few times.
Lemma. For $0 < c_1 < c_2$ and $b > 1$,
$$
\sum_{c_1b^k \leq p \leq c_2b^k} \frac{1}{p} \sim \frac{\log_b(c_2/c_1)}{k}
$$
as $k \to \infty$, where the sum on the left runs over primes.
Proof.
Our argument is based on p. 7 here, which is the paper cited at the end of the Wikipedia page about Dirichlet density. That paper
proves a much more general result than what we need.
Using partial summation, for $x \geq 1$
$$
\sum_{p \leq x} \frac{1}{p} = \frac{\pi(x)}{x} + \int_1^x \frac{\pi(y)}{y^2}\,dy.
$$
Therefore
\begin{align*}
\sum_{c_1b^k \leq p \leq c_2b^k} \frac{1}{p}  
& = \sum_{p \leq c_2b^k} \frac{1}{p}  - \sum_{p \leq c_1b^k} \frac{1}{p} + O\left(\frac{1}{b^k}\right)   \\
& = \frac{\pi(c_2b^k)}{c_2b^k} -  \frac{\pi(c_1b^k)}{c_1b^k} + \int_{c_1b^k}^{c_2b^k} \frac{\pi(y)}{y^2}\,dy  + O\left(\frac{1}{b^k}\right). 
 \end{align*}
To show this is asymptotic to $\log_b(c_2/c_1)/k$ as $k \to \infty$,
we will show
$$
\frac{\pi(c_2b^k)}{c_2b^k} -  \frac{\pi(c_1b^k)}{c_1b^k} = o\left(\frac{1}{k}\right), \ \ \ 
\int_{c_1b^k}^{c_2b^k} \frac{\pi(y)}{y^2}\,dy  \sim \frac{\log_b(c_2/c_1)}{k}.
$$
By the Prime Number Theorem, $\pi(c_2b^k) \sim c_2b^k/\log(c_2b^k) \sim c_2b^k/(k\log b)$ and
$\pi(c_1b^k) \sim c_1b^k/(k\log b)$ as $k \to \infty$, so
$$
k\left(\frac{\pi(c_2b^k)}{c_2b^k} -  \frac{\pi(c_1b^k)}{c_1b^k}\right) \to \frac{1}{\log b} - \frac{1}{\log b} = 0.
$$
Thus $\pi(c_2b^k)/c_2b^k - \pi(c_1b^k)/c_1b^k = o(1/k)$ as $k \to \infty$.
To estimate $\int_{c_1b^k}^{c_2b^k} (\pi(y)/y^2)\,dy$, pick $\varepsilon > 0$. For
large $y$, say $y \geq y_\varepsilon$, we have
$1-\varepsilon \leq \pi(y)/(y/\log y) \leq 1+\varepsilon$,
so $(1-\varepsilon)/(y\log y) \leq \pi(y)/y^2 \leq (1+\varepsilon)/(y\log y)$.
For $k$ large enough that $c_1b^k \geq y_\varepsilon$,
\begin{equation}\label{int-long}
(1-\varepsilon)\int_{c_1b^k}^{c_2b^k}\frac{dy}{y\log y} \leq 
\int_{c_1b^k}^{c_2b^k} \frac{\pi(y)}{y^2}\,dy \leq 
(1+\varepsilon)\int_{c_1b^k}^{c_2b^k}\frac{dy}{y\log y}, 
\end{equation}
and as $k \to \infty$,
\begin{align*}
\int_{c_1b^k}^{c_2b^k}\frac{dy}{y\log y} = \log\log(c_2b^k) - \log\log(c_1b^k) 
& = \log\left(\frac{k\log b + \log c_2}{k\log b + \log c_1}\right) \\
& = \log\left(1 + \frac{\log_b(c_2/c_1)}{k + \log_b(c_1)}\right) \\
& = \frac{\log_b(c_2/c_1)}{k + \log_b(c_1)} + O\left(\frac{1}{k^2}\right) \\
& = \frac{\log_b(c_2/c_1)}{k} + O\left(\frac{1}{k^2}\right).
\end{align*}
Therefore
$$
1-\varepsilon \leq \varliminf_{k \to \infty} \frac{\int_{c_1b^k}^{c_2b^k} (\pi(y)/y^2)\,dy}{\log_b(c_2/c_1)/k} \leq
\varlimsup_{k \to \infty} \frac{\int_{c_1b^k}^{c_2b^k} (\pi(y)/y^2)\,dy}{\log_b(c_2/c_1)/k} \leq 1 + \varepsilon.
$$
Taking $\varepsilon \to 0^+$ shows
$\int_{c_1b^k}^{c_2b^k} (\pi(y)/y^2)\,dy \sim \log_b(c_2/c_1)/k$, so we're done.  QED
For $d \in \{1, \ldots, 9\}$, let $A_d$ be the set of primes with leading digit $d$. For example,
\begin{align*}
A_1 & = \{11, 13, 17, 19, 101, 103, 107, 109, 113, 127, 131, 137, 139, \ldots\}, \\
A_2 & = \{2, 23, 29, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, \ldots\}.
\end{align*}
We can describe the primes in $A_d$ in terms of inequalities:
$$
A_d = \{p : d \cdot 10^k \leq p < (d+1)10^k \ {\rm for \ some } \ k \geq 0\}.
$$
Theorem.
For each $d$, $A_d$ has logarithmic density $\log_{10}((d+1)/d)$.
Since existence of logarithmic density implies existence of Dirichlet density with the same value, $A_d$ has Dirichlet density $\log_{10}((d+1)/d)$.
Proof.
Instead of estimating
$$
\frac{\sum_{p \in A_d, p \leq x} 1/p}{\log \log x} 
$$
for large $x$, we want to restrict $x$ to powers of $10$.
We will first check the ratio changes negligibly when $x$ runs between
consecutive powers of $10$. For $n \geq 1$, if $10^n \leq x < 10^{n+1}$
then
$$
\log n + \log \log 10 \leq \log\log x < \log(n+1) + \log \log 10,
$$ so
$\log \log x \sim \log n$ as $x \to \infty$. We will show
$$
\frac{\sum_{p \in A_d, 10^n \leq p < 10^{n+1}} 1/p}{\log n} \to 0 \ {\rm as } \ n \to \infty, 
$$
so
$$
\lim_{x \to \infty} \frac{\sum_{p \in A_d, p \leq x} 1/p}{\log \log x}  = 
\lim_{n \to \infty} \frac{\sum_{p \in A_d, p < 10^n} 1/p}{\log n}, 
$$
in the sense that if the limit on the right exists then so does the limit on the left and they agree.
If $d \not= 1$ then $\{p \in A_d : 10^n \leq p < 10^{n+1}\} = \emptyset$.
If $d = 1$ then $\{p \in A_d : 10^n \leq p < 10^{n+1}\} = \{p : 10^n \leq p \leq 2 \cdot 10^{n}\}$ and
$$
\sum_{10^n \leq p \leq 2 \cdot 10^{n}} \frac{1}{p} \sim \frac{\log_{10} 2}{n}
$$
by the lemma, so
$$
\frac{\sum_{p \in A_1, 10^n \leq p < 10^{n+1}} 1/p}{\log n} \sim \frac{\log_{10} 2}{n\log n} \to 0.
$$
It remains to show
$$
\lim_{n \to \infty} \frac{\sum_{p \in A_d, p < 10^n} 1/p}{\log n} = \log_{10}\left(\frac{d+1}{d}\right).
$$
Break up the numerator into sums between consecutive powers of $10$:
$$
\sum_{p \in A_d, p < 10^n} \frac{1}{p} = 
\sum_{0 \leq k \leq n-1} \left(\sum_{d \cdot 10^k \leq p <  (d+1)10^k} \frac{1}{p}\right).
$$
For $k \geq 1$,
$$
\sum_{d \cdot 10^k \leq p <  (d+1)10^k} \frac{1}{p} = 
\sum_{d \cdot 10^k \leq p \leq  (d+1)10^k} \frac{1}{p} \sim \frac{\log_{10}((d+1)/d)}{k}
$$
by the lemma. Therefore
$$
\sum_{p \in A_d, p < 10^n} \frac{1}{p}  
\sim \sum_{1 \leq k \leq n-1} \frac{\log_{10}((d+1)/d)}{k} \sim \log_{10}\left(\frac{d+1}{d}\right)\log n, 
$$
so $A_d$ has logarithmic density $\log_{10}((d+1)/d)$.  QED
Remark.
In a similar way, if $m \geq 2$ and $1 \leq a \leq m-1$, then the set of primes whose number of digits (in base $10$, say) is congruent to $a \bmod m$ has logarithmic density $1/m$ (it has no natural density).  For example, the set of primes with an odd number of digits has logarithmic density $1/2$.