Which composite number in a prime gap has the most divisors?

205 Views Asked by At

Let $p_n$ be the $n$-th prime. We define

Most composite number: The composite number $m_n$ between $p_n$ and $p_{n+1}$ such that $m_n$ has the more divisors than any other composites in this prime gap.

Least composite number: The composite number $l_n$ between $p_n$ and $p_{n+1}$ such that $l_n$ has less divisors than any other composite in this prime gap.

If two or more composites in a prime gap have the highest or the lowest number of divisors then we define $m_n$ or $l_n$ to be the smallest among them.

Motivation: In this prime gap, where are $m_n$ and $l_n$ likely to occur? Intuitively, bigger numbers are expected to have more divisors and so we might expect $m_n$ to be closer to $p_{n+1}$ and $l_n$ to be closer to $p_n$. Experimental data shows that this naive intuition is only true for $l_n$ but for $m_n$ is more likely to be halfway between $p_n$ and $p_{n+1}$.

Experiment: Divide the gap between $p_n$ and $p_{n+1}$ into $2k$ equal parts for some fixed $k > 1, i = 0, 1, \ldots, 2k-1$. Note that every composite in the prime gap will fall in one of these intervals however, not every interval will contain a composite especially if $2k > p_{n+1} - p_n$ however this does not impact our experiment.

$$ \left(p_n + \frac{i(p_{n+1} - p_n)}{2k}, p_n + \frac{(i+1)(p_{n+1} - p_n)}{2k} \right] $$

We plot a graph with $i$ on the $X$-axis and the frequency the above interval contains $m_n$ on the $Y$-axis for different values of $n$.

Observation: The data shows that given any $k$, the most composite number $m_n$ has the highest frequency in the interval

$$ \left(p_n + \frac{(k-1)(p_{n+1} - p_n)}{2k}, p_n + \frac{k(p_{n+1} - p_n)}{2k} \right] \tag 1 $$

and lowest frequency in in the very next interval $$ \left(p_n + \frac{k(p_{n+1} - p_n)}{2k}, p_n + \frac{(k+1)(p_{n+1} - p_n)}{2k} \right] \tag 2 $$

The experiment was run twice, first for $n \le 10^8$ and second for $2.8 \times 10^{16} < n < 2.8 \times 10^{16} + 10^7$. In both cases, consistent result was observed. Numerically, for $k=5$, and $2.8 \times 10^{16} < n < 2.8 \times 10^{16} + 10^7$ about $17.7\%$ of $m_n$ occurred in $(1)$ the middle decile; the next highest was $11.2\%$ which occurred in the first decile and only $5.98\%$ fell in $(2)$; the middle decile.

This shows that the mid-point $\displaystyle \frac{p_n + p_{n+1}}{2}$ is the top candidate for being the most composite number. Also since interval $(1)$ had the highest frequency while $(2)$ had the lowest frequency, in case the mid-point did not have the highest number of divisors, the next best candidate would be the composite preceding the mid-point.

Question: Is it true that the mid-point and the number preceding the mid-point is more likely to have more divisors and any other composites in a prime gap?

1

There are 1 best solutions below

0
On

Assuming we are counting all divisors of a composite number, not just its distinct prime divisors, the following considerations suggest that the most composite number $m_n$ is not likely to be at the mid-point of a gap between consecutive primes.

Odd primes $>3$ are $\equiv \pm 1 \pmod 6$, and $6$ is the most common prime gap between consecutive primes $<10^{35}$ (https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/2870).

For consecutive primes $p_n$, $p_{n+1}$, denoting $p_{n+1}-p_n$ as $g(p_n)$, for $n>1$ an odd number of composite numbers lie between $p_n$ and $p_{n+1}$. Since $6=2\cdot 3$ is the smallest primorial, the central number in the gap $c$ is likely to be the most composite number $m_n$ only if $6|c$. But for $g=4$, $8$, $12$, $16$, $20$, $24$…, $c$ is odd, and of the remaining $g=6$, $10$, $14$, $18$, $22$, $26$…, $6|c$ only if $g=10$, $14$, $22$, $26$…, i.e. only if $6\not{|}g$. Some examples may help to clarify and confirm this.

For $g(p_n)=6$, and $p_n\equiv-1\pmod 6$, $p_n+1$ is the only composite number in the gap to have both $2$ and $3$ as divisors. Hence it seems in these cases the most composite number $m_n$ is more likely the first number, not the middle, or number preceding the middle, of the gap—e.g $24$ (eight divisors), not $26$ or $25$ (four and three divisors, respectively), for $p=23$, and $84$ (twelve divisors), not $86$ or $85$ (four divisors each), for $p=83$. Accordingly we find that, for the first ten $p_n\equiv-1\pmod 6$, namely $23$, $47$, $53$, $131$, $167$, $173$, $233$, $251$, $257$, $263$, $m_n=c=p_n+3$ only for $173$ and $257$. For all the rest, $m_n=p_n+1$

For $p_n\equiv +1 \pmod 6$, and again a prime gap of $6$, the most composite number $m_n$, with divisors $2$ and $3$, is normally the last number in the gap, e.g. $36$ (nine divisors), not $34$ or $33$ (four divisors each), for $p=31$, and $78$ (eight divisors), not $76$ or $75$ (six divisors each), for $p=73$. Of the first ten $p_n\equiv+1\pmod6$, i.e. $31$, $61$, $73$, $151$, $157$, $271$, $331$, $367$, $373$, $433$, $m_n=c=p_n+3$ only for $157$, and for all but one of the rest, $m_n=p_n+5$.

For $g(p_n)=6$, then, the most composite number $m_n$ seems more likely to lie at the beginning or end of the gap, where it is certain to contain at least eight divisors, than in the middle of the gap.

If $g(p_n)=4$, then $p_n\equiv +1\pmod6$, and the gap contains no multiple of $6$. But $m_n$ seems less likely to be $c$, which is odd, than whichever of its two even neighbors is a multiple of $4$.

If $g(p_n)=8$, and hence $p_n\equiv-1\pmod6$, then again $c$ is odd, and $6$ divides the first and last numbers, $p_n+1$ and $p_{n+1}-1$.

For $g(p_n)=10$, the next most common gap after $6$, $2$, and $4$ for $n\le168$, $p_n=139, 181, 241, 283, 337, 409, 421, 547, 631, 709, 787, 811, 829, 919$Since here always $p_n\equiv+1\pmod6$, and $p_{n+1}\equiv-1\pmod6$, then $6$ divides $c$ alone, which accordingly does seem likely to be the most composite. And indeed we find $c=p_n+5=m_n$ with $15$, $18$, $16$, $16$, $24$, $20$, $24$ divisors for $p_n=139$, $283$, $547$, $709$, $787$, $811$, $919$, respectively--fully half of the numbers in the sample sequence. Moreover, for $p_n=241$ and $409$, $m_n$ with $8$ and $12$ divisors, respectively, appears at $c$, although later numbers in the gap have as many divisors. But for $p_n=181$, $337$, $421$, numbers with $8$, $12$, $8$ divisors appear at $c$ but earlier in the gap as well, so they don't meet the definition of $m_n$. And lastly, for $p_n=631$ and $829$, the most composite numbers lie not at $c$ (fifth) but at ninth and third position, respectively, in the gap. Still, from this sample it seems $c$ is the more likely place (for nine of the fourteen $p_n$) to find $m_n$ when $g(n)=10$, since $6$ divides that number alone. But exceptions are not uncommon, e.g. as in $p_n=829$, where $832$, not in mid-position, has $13$ and several powers of $2$ for divisors, while $c=834$ has only $2$, $3$ and $139$ for prime divisors.

But for $g(n)=12$, where again $p_n\equiv\pm1\pmod6$, $6$ divides either the fifth and eleventh number in the gap, or the first and seventh, not $c$ (the sixth, although the fifth is one before the sixth). Accordingly, taking the first four $p_n$ with a $12$-gap: for $p_n=199$ and $211\equiv+1\pmod6$, $m_n$ is the eleventh and fifth member of the gap (sixteen divisors each), and for $p_n=467$ and $509\equiv-1\pmod6$, $m_n$ is the first number in the gap, with eighteen and sixteen divisors, respectively.

And generalizing, it can be seen that $6$ will not divide the middle number $c$ for any prime gap which is a multiple of $6$—the gap following about $41$% of all $p_n$ for $n\approx5\times10^7$ (https://www.researchgate.net/figure/Here-we-list-the-different-gap-distribution-percentages-for-different-size-of_fig1_280732251%20%5Baccessed%2010%20Dec,%202023%5D), —for $c$ is then either odd, or even but not divisible by $3$.

$g=14$ is the next gap in which $6$ divides $c$. For $p_n=113$, $293$, $317$, $773$, $839$, $863$, $953$, $c=p_n+7=m_n$ with $16$, $18$, $24$, $28$ divisors for $113$, $293$, $773$, $953$, respectively, but $p_n+1=m_n$ with $32$, $24$ divisors for $839$, $863$, respectively, and $p_{n+1}-1=m_n$ with $16$ divisors for $317$. Thus $c=m_n$ in four of these seven cases.

To conclude, then, the most composite number in $g(p_n)$ seems unlikely to be $\frac{p_n+p_{n+1}}{2}$, since $6$ divides that number only for $g(p_n)=10$, $14$, $22$, $26$…, and these gaps are among the less common since they are not multiples of $6$.

Is there a flaw in this approach to the question, or has some inadvertent bias or restriction skewed the results of OP’s experiment?