TITLE: What proportion of positive integers have two factors that differ by 1?
QUESTION [58 upvotes]: What proportion of positive integers have two factors that differ by 1?
This question occurred to me
while trying to figure out
why there are 7 days in a week.
I looked at 364,
the number of days closest to a year
(there are about 364.2422
days in a year, iirc).
Since
$364 = 2\cdot 2 \cdot 7 \cdot 13$,
the number of possible
number that evenly divide a year
are
2, 4, 7, 13, 14, 26, 28,
and larger.
Given this,
7 looks reasonable -
2 and 4 are too short
and 13 is too long.
Anyway,
I noticed that
13 and 14 are there,
and wondered how often
this happens.
I wasn't able to figure out
a nice way to specify the
probability
(as in a Hardy-Littlewood
product),
and wasn't able to 
do it from the inverse direction
(i.e., sort of a sieve
with n(n+1) going into
the array of integers).
Ideally, I would like
an asymptotic function
f(x) such that
$\lim_{n \to \infty} \dfrac{\text{number of such integers } \ge 2 \le nx}{n}
=f(x)
$
or find $c$ such that
$\lim_{n \to \infty} \dfrac{\text{number of such integers } \ge 2 \le n}{n}
=c
$.
My guess is that,
in the latter case,
$c = 0$ or 1,
but I have no idea which is true.
Maybe its 
$1-\frac1{e}$.
Note: I have modified this
to not allow 1 as a divisor.

REPLY [7 votes]: I've used Dan's idea to attempt to formalise the problem some more. Define $d(k,i)$ as the number of pairs of consecutive divisors of $i$ up to $(k+2)$. Then $c(k,i)$ stops $d$ from over-counting and is the indicator function for whether $(k+1)$, $(k+2)$ are the first pair of consecutive divisors of $i$. 
$$\begin{aligned}
d(k,i)&=
\sum_{j=1}^{k}\delta_{(i\%(j+1)(j+2))}\\
c(k,i)&=\begin{cases}
0,&d(k,i)>1\lor d(k-1,n)=1\\
d(k,i),&\text{else}
\end{cases}
\end{aligned}$$
Where $\%$ is the modulo operator and $\delta_x$ is the single argument Kronecker delta. The proportion we want is then:
$$p=\frac16+\lim_{n\to\infty}\frac1{n}\sum_{i=1}^n\sum_{k=2}^{\lfloor\sqrt{i}\rfloor}c(k,i)\\$$
The sum over $k$ represents different divisors, while the sum over $i$ represents different dividends. Here is a python script for a former rearrangement of the equations. They agree with the $0.2219$ estimates others have provided. Bear in mind they're  slow but can potentially be manipulated.
To proceed further, we could try simplifying $c(k,i)$ or sieve techniques. Swapping round the sums is equivalent to how Dan has found the values $\frac16,0,\frac1{20}-\frac1{60},\ldots$ for $k=1,2,3,\ldots$. Similarly, we can swap round the sum operators, then fix $k$ and look at the sequence of partial sums of $\sum_{i=1}^nc$.
I used $n$ in powers of $2$, to make the sequence manageable. By comparing the partial sums of $\sum_{i=1}^{2^n}c$ with sequences on OEIS, I found that when $k=1$, the nonzero partial sums of the sequence match this sequence. But when $k=3$, the nonzero partial sums of $\sum_{i=1}^{2^n}c$ match this sequence. So perhaps $\sum_{i=1}^{2^n}c$ can be expressed as the expansions of rational functions.
From playing with the output of the code, it seems as though $\sum_{i=1}^nc$ is nonzero iff $k\equiv0\mod3$, i.e. you only need to check every third divisor in Dan's answer.