Is $\left(n+\frac{1}{2}\right) H_n+(\gamma -1) n$ a better asymptotic to the partial sums of the number of divisors than $n (\log (n)+2 \gamma -1)$? The partial sums of the number divisors can be written in Mathematica as:
$$\sum _{k=1}^n \sigma _0(k)=\sum _{k=1}^n \left(\sum _{q=1}^{\frac{n}{k}} \frac{1}{q^s}\right)$$
which is sequence A006218 in the OEIS, starting:
1, 3, 5, 8, 10, 14, 16, 20, 23, 27, 29, 35, 37, 41, 45,...

Mathematica knows that:
$$\lim_{n\to x} \, \left(\sum _{q=1}^{\frac{n}{k}} \frac{1}{q^s}\right)=\zeta (s)-\zeta \left(s,\frac{k+x}{k}\right)$$
 Limit[Sum[1/q^s, {q, 1, n/k}], n -> x]

Now truncate the sums at $n_1=1,\; n_1=2,\; n_1=3,\; n_1=4\,\; n_1=5$ and $n_1=6$, and let $n$ be a vector from $1$ to $6!$ like this:
$$r_1=0$$
$$r_{i+1} = \text{Mean}\left[\sum _{k=1}^{n_1} \left(\zeta (s)-\zeta \left(s,\frac{n}{k}+1\right)\right) - \sum _{k=1}^{n_1} \left(\sum _{q=1}^{\frac{n}{k}} \frac{1}{q^s}\right)-r_i \right]$$
where $i=1,2,3,4,5$
We can compute $r_i$  by running this Mathematica program:
(*start*)
Clear[nn, s, n1, A, B k, n, q, r];
nn = 1*2*3*4*5*6;
s = 0;
(*n1=2;*)
r = 0;
Table[Show[
  ListPlot[A = 
    Table[Re[Sum[Sum[1/q^s, {k, 1, n/k}], {k, 1, n1}]], {n, 1, nn}]], 
  ListLinePlot[
   B = Table[
     Re[Sum[Zeta[s] - HurwitzZeta[s, n/k + 1], {k, 1, n1}]] + r, {n, 
      1, nn}], PlotStyle -> Red]];
 ListLinePlot[A - B];
 r = r + Mean[A - B];
 r, {n1, 1, 6}]
Differences[%]
(*end*)

we then get the output:
{0, -(1/4), -(7/12), -(23/24), -(163/120), -(71/40)}

of which the first differences are:
 {-(1/4), -(1/3), -(3/8), -(2/5), -(5/12)}

as unreduced fractions that is:
 {-(1/4), -(2/6), -(3/8), -(4/10), -(5/12)}

which looks like the first differences of the sum:
$$\sum _{k=1}^{n_1} \frac{1-k}{2 k}$$
Setting s to any integer the general term seems to be:
$$\sum _{k=1}^{n_1} \frac{(1-k) \left(\frac{n}{k}\right)^{-s}}{2 k}$$
Adding this into the above, we get:
$$\sum _{k=1}^{n_1} \left(\sum _{q=1}^{\frac{n}{k}} \frac{1}{q^s}\right) = \sum _{k=1}^{n_1} \left(\zeta (s)-\zeta \left(s,\frac{n}{k}+1\right)\right)+\sum _{k=1}^{n_1} \frac{1-k}{2 k}$$
Returning to the untruncated expression - that is, replacing $n_1$ with $n$ - and also adding a second conjecture we now have:
$$\sum _{k=1}^n \sigma _0(k) = \sum _{k=1}^{n} \left(\sum _{q=1}^{\frac{n}{k}} \frac{1}{q^s}\right) \approx \sum _{k=1}^{n} \left(\zeta (s)-\zeta \left(s,\frac{n}{k}+1\right)\right)+  \underbrace{\sum _{k=1}^{n} \frac{1-k}{2 k}}_{\text{conjectured from the fractions r}} + \underbrace{\left(\gamma -\frac{1}{2}\right)n}_{\textbf{second conjecture}}$$
$$\sum _{k=1}^{n} \left(\zeta (s)-\zeta \left(s,\frac{n}{k}+1\right)\right) = n H_n$$
$$\sum _{k=1}^{n} \frac{1-k}{2 k} = \frac{H_n-n}{2}$$
Inserting:
$$\sum _{k=1}^n \sigma _0(k) = \sum _{k=1}^{n} \left(\sum _{q=1}^{\frac{n}{k}} \frac{1}{q^s}\right) \approx n H_n +  \underbrace{\frac{H_n-n}{2}}_{\text{conjectured from the fractions r}} + \underbrace{\left(\gamma -\frac{1}{2}\right)n}_{\text{second conjecture}}$$
and simplifying:
$$\sum _{k=1}^n \sigma _0(k) \approx \left(n+\frac{1}{2}\right) H_n+(\gamma -1) n$$
Comparing with the main term in Dirichlet divisor problem:
$$\sum _{k=1}^n \sigma _0(k) \approx n (\log (n)+2 \gamma -1)$$
First 8 terms:

The suggested new asymptotic:

Dirichlet's asymptotic in the OEIS:

I notice that the asymptotic given in the OEIS has a bias towards the more negative values.

Why is that? Has anyone ever written a better asymptotic for the partial sums of the number of divisors?

 A: We can consider approximations of the form
$$
\sum\limits_{k = 1}^n {\sigma _0 (k)}  \approx \left( {n + \frac{1}{2}} \right)\log n + n(2\gamma  - 1) + c \tag{$\star$}
$$
Your suggested approximation is essentially of this form with $c = \frac{{\gamma  + 1}}{2} = 0.7886078324 \ldots$. (Just use Euler's approximation for the harmonic numbers.) It is reasonable to choose $c$ so that the average error is small, i.e.,
$$
\sum\limits_{n = 1}^N {\left[ {\left( {\sum\limits_{k = 1}^n {\sigma _0 (k)} } \right) - \left( {\left( {n + \frac{1}{2}} \right)\log n + n(2\gamma  - 1) + c} \right)} \right]} 
$$
is small for any $N$. This means that the best choice for $c$ should be
$$
c = \mathop {\lim }\limits_{N \to  + \infty } \frac{1}{N}\sum\limits_{n = 1}^N {\left[ {\left( {\sum\limits_{k = 1}^n {\sigma _0 (k)} } \right) - \left( {\left( {n + \frac{1}{2}} \right)\log n + n(2\gamma  - 1)} \right)} \right]} ,
$$
provided this limit exists. This is equivalent, with the aid of Stirling's formula, to
$$
c = \mathop {\lim }\limits_{N \to  + \infty } \left( {\frac{1}{N}\left( {\sum\limits_{n = 1}^N {\Delta (n)} } \right) - \frac{{\log N - 1}}{2}} \right),
$$
using the standard notation for the error term in Dirichlet's approximation. Fortunately this limit exists and equals
$$
c = \gamma  + \frac{1}{4} = {\rm 0}{\rm .8272156649} \ldots ,
$$
by a result of Voronoï (Ann. École Normale 21 (1904), no. 3, pp. 207$–$267, pp. 459$–$533).

So in the above sense,
$$
\sum\limits_{k = 1}^n {\sigma _0 (k)}  \approx \left( {n + \frac{1}{2}} \right)\log n + n(2\gamma  - 1) + \gamma  + \frac{1}{4}
$$
is the best approximation among the approximations of the form $(\star)$. In terms of the harmonic numbers
$$
\sum\limits_{k = 1}^n {\sigma _0 (k)}  \approx \left( {n + \frac{1}{2}} \right)H_n  + (\gamma  - 1)n + \frac{{2\gamma  - 1}}{4},
$$
with $\frac{{2\gamma  - 1}}{4} = 0.03860783245 \ldots$.
