4
$\begingroup$

The origin of the following question is irrelevant and will hence be skipped. Hopefully, it will be interesting without context.

Consider the following algorithm. We will use $p_i$ to denote the $i$-th prime.

We start with $m_k=p_k$. For $i=k−1$ down to $1$, let $m_i$ be the smallest multiple of $p_i$ greater than $m_{i+1}$ that is not divisible by any prime less than $p_i$. This goes upto the smallest prime, $p_1=2$. For example, if we start with $p_4=7$, then $m_3=25$, $m_2=27$ and $m_1=28$. Similarly, if we start with $p_5=11$, then $m_1=58$.

My question is whether we can tell anything about the asymptotics of the growth of $m_1$ better than the crude approximate (which only uses the fact that out of $P_m=p_1p_2\dots p_m$ integers, at least one will be divisible by $p_m$ and coprime to the rest of the primes below it), which is useless. I did some computations and I believe that $m_1$ is in $\mathcal O(p_k^2)$ although I do not have any idea how it might be possible to achieve that.

After trying to do some research, I came to know about the Jacobsthal function $j(n)$ which is defined as the smallest positive integer $m$, such that every sequence of $m$ consecutive integers contains an integer coprime to $n$. This is slightly different from what we are after. We want an integer coprime to $p_{i-1}\#$ as well as divisible by $p_i$ (where $p\#$ is the product of all primes less than or equal to $p$, also known as the primorial). I came to know about Iwaniec's result that $$j(n)\ll (\log n)^2 \implies j(p_n\#)\ll (n\log n)^2$$ but I am not sure whether it is possible to use the Jacobsthal function in our case.

Here's a code (by DeepSeek) in case anyone is interested.

import math

def is_prime(n):
    if n < 2:
        return False
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    for i in range(3, int(math.isqrt(n)) + 1, 2):
        if n % i == 0:
            return False
    return True

def prev_prime(p):
    q = p - 1
    while q >= 2:
        if is_prime(q):
            return q
        q -= 1
    return None

def generate_sequence(p):
    if not is_prime(p):
        raise ValueError("Input must be a prime number")
    
    current = p
    sequence = [current]
    print(f"Step 0: p = {p} → {current}")
    
    step = 1
    q = prev_prime(p)
    
    while q is not None:
        # Find smallest multiple of q greater than current
        k = current // q + 1
        candidate = k * q
        
        # Find all primes smaller than q
        small_primes = [r for r in range(2, q) if is_prime(r)]
        
        # Find next valid candidate
        while True:
            valid = True
            for r in small_primes:
                if candidate % r == 0:
                    valid = False
                    break
            if valid:
                break
            k += 1
            candidate = k * q
        
        current = candidate
        sequence.append(current)
        print(f"Step {step}: q_{step} = {q}, m_{step} = {candidate} → {current}")
        
        step += 1
        q = prev_prime(q)
    
    return sequence

# Get user input
try:
    p = int(input("Enter a prime number: "))
    seq = generate_sequence(p)
    print("\nFinal sequence:", seq)
except ValueError as e:
    print(e)
$\endgroup$

1 Answer 1

6
$\begingroup$

By Theorem 2 in this paper of Iwaniec (1971), it is straightforward to see for any $i\in\{1,\dotsc,k-1\}$ that $$0<m_i-m_{i+1}\leq p_i(C_0(i-1)+1)\ll p_i^3.$$ Hence for $k\geq 2$ we obtain that $$m_1=p_k+\sum_{i=1}^{k-1}(m_i-m_{i+1})\ll kp_k^3\ll k^4(\log k)^3.$$

$\endgroup$
2
  • $\begingroup$ Thanks for the reference (+1)! Do you happen to know any (useful) lower bounds of $m_1$? That would give us an idea of the correct order. $\endgroup$ Commented Jul 14 at 16:53
  • 1
    $\begingroup$ @SayanDutta I don't know any lower bound other than the obvious $m_1\geq m_{k-1}=p_k^2$. I think that finding the correct order of $m_1$ (or just $m_{k-2}$) is a very difficult problem. The exponent $4$ in the final bound is surely not the right one, but decreasing it might already be a difficult problem. This harmonizes with the fact that the best known lower and upper bounds for $C_0(r)$ and $C(r)$ are far from each other. See the quoted paper of Iwaniec (1971) and also the follow-up paper from 1978: degruyterbrill.com/document/doi/10.1515/dema-1978-0121/html $\endgroup$ Commented Jul 14 at 18:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.