Do the numbers preceding primes have on an average fewer divisors than the numbers succeeding primes?

145 Views Asked by At

I wanted to see if the numbers preceding primes behaved differently in any way form the numbers succeeding primes so I calculated at the average number of divisors of number of the form $p-1$ and $p+1$ where $p$ is a prime.

Let $d(n)$ be the number of divisors of $n$. Define $f(x) = \sum_{p \le x} d(p-1)$ and $g(x) = \sum_{p \le x} d(p+1)$ where $p$ is a prime. I observed that there are only $3251$ instances where $f(x) < g(x)$. The largest value of $x$ for which this is true is $x = 3752789$. After checking till $x \le 1.9 \times 10^{10}$, I could not find the inequality reversing again.

This the data shows that the numbers preceding primes have on a average fewer number of divisors than the numbers succeeding primes. The graph below shows the actual data.

Question: Is there any reason why this should be true?

enter image description here

Source code

import numpy
p = 2
i = fd = fp = 0
d1 = d2 = p1 = p2 = 0
target = step = 10^6

while True:
    i  = i + 1  
    d1 = d1 + len(divisors(p-1))
    d2 = d2 + len(divisors(p+1))
    if d1 > d2:
        fd = fd + 1
    
    p1 = p1 + len(prime_factors(p-1))
    p2 = p2 + len(prime_factors(p+1))
    if p1 > p2:
        fp = fp + 1
        
    if i > target:
        print i,p,d1,d2,fd, d2-d1,(d2-d1)/i.n(), p1,p2,fp, p2-p1
        target = target + step
        
    p = next_prime(p)
1

There are 1 best solutions below

0
On

Too long for a comment,

For $a=\pm 1$ $$\sum_p d(p -a)p^{-s}=\sum_{k\ge 1} \sum_{lk+a \ prime} (lk+a)^{-s}=\sum_{k\ge 1} \sum_{\chi\bmod k} \frac{\chi(a)}{\varphi(k)}\sum_p \chi(p)p^{-s}$$

$$\sum_p (d(p-1)-d(p+1))p^{-s}=\sum_k \sum_{\chi\bmod k} \frac{1-\chi(-1)}{\varphi(k)}\sum_p \chi(p)p^{-s}$$

Under the GRH each term is analytic for $\Re(s) > 1/2$,

If $\chi^2$ is a non-trivial character then $\sum_p \chi(p)p^{-s}$ is analytic at $s=1/2$, if $\chi$ is a quadratic character then as $s\to 1/2^+$ $$\sum_p \chi(p)p^{-s}=\sum_{m\ge 1}\frac{\mu(m)}{m}\log L(sm,\chi^m)\sim \frac{1}2\log(s-1/2)$$

thus $$\lim_{s\to 1/2^+}\frac{ \frac{1-\chi(-1)}{\varphi(k)}\sum_p \chi(p)p^{-s}}{\log(s-1/2)} =\frac{1_{\chi \text{ is a quadratic odd character}}}{\varphi(k)}$$ Is this not too bad to conjecture that ? $$\lim_{s\to 1/2^+}\sum_p (d(p-1)-d(p+1))p^{-s}=\color{red}{-\infty}$$ Estimating the growth of $\sum_{p\le x} d(p-1)-d(p+1)$ thus the abscissa of convergence of the Dirichlet series would help.