TITLE: How are the ratios of successive values of the divisor function distributed?
QUESTION [6 upvotes]: One motivation for this question is a paper by Erdos and Hall "Values of the divisor function on short intervals", in which the authors obtain the leading asymptotics
$$x(\log x)^{2(\sqrt 2-1)-\epsilon}\leq\sum_{n\leq x}\min{(d(n),d(n+1))}\leq x(\log x)^{2(\sqrt 2-1)}$$ and
$$\sum_{n\leq x}\max{(d(n),d(n+1),...,d(n+k-1)})\sim kx\log x.$$ In particular, it is possible that the answer to this question will lead to refinements of these bounds. It is also interesting simply as a curiosity.
Let $r(n)=d(n+1)/d(n)$. Heath-Brown proved that $r(n)=1$ for infinity many $n$, but I don't know how often this is expected to happen. Recent advances in knowledge of the gaps between primes suggests that small and large values are common.


What is known about the distribution of values of $r(n)$?

In particular, is it known that $r(n)$ is neither bounded above or below?



EDIT: $r(n)$ is neither bounded above or below - the proof is easy so I suppose that's not news though.

REPLY [4 votes]: Under GRH, Titchmarsh showed 1931 that $\sum_{p\leq x}\tau(p+a)\sim C(a)x$, where summation runs over primes only. 1963 Linnik proved the same unconditionally, hence there are many $n$ such that $d(n)=2$, $d(n+1)\gg\log n$ and similarly for $n-1$. Hence $r(n)$ is  quite often as big as $\log n$ and as small as $\frac{1}{\log n}$. 
In general $r(n)$ is much closer to 1. Using some standard techniques in probabilistic number theory you can show that the joint distribution of $(\omega(n), \omega(n+1))$ is normal with mean and variance $\log\log x$, hence the distribution of $\log r(n)$ is normal with variance $2\log\log n$. 
You can construct extreme values of $r(n)$ by taking an integer $n$ with many divisors, and look for a prime $p\equiv \pm 1\pmod{n}$. By Heath-Browns version of Linnik's theorem, for $n>n_0$ such a prime $p$ exists satisfying $p\leq n^{5.5}$, hence $\max_{p\leq x} d(p+1)\geq \max_{n\leq x^{2/11}}d(n)$, thus for some small $c>0$ we have that $r(n)>e^{c\log n/\log\log n}$ has infinitely many solutions.