For a positive integer $n$ let $$f(n):=\min\{m\in \mathbb N: m>1, \gcd(m,n)=1\} .$$ Equivalently, $f(n) $ is the smallest prime not dividing $n$. Is there any upper bound literature for this? It is not difficult to prove that $$ \#\{1<m\leq x: \gcd(m,n)=1 \} \geq \frac{\phi(n) }{n } x-1-2^{\omega(n) }, $$ hence, $$f(n) \leq 2 + 2^{\omega(n) }\frac{n }{\phi(n) }\leq 2+ 4^{\omega(n ) } .$$ If $n=\prod_{p\leq t}p$ then $f(n) \asymp t \asymp \omega(n) \log \omega(n)$, so perhaps something polynomial in $\omega(n)$ might be achievable for general $n$. Is it possible to improve this as function of $\omega$? PS. I do not care about bounds without $\omega$, since these are easy. For example, all primes $p<f(n)$ must divide $n$ hence $$ \prod_{p<f(n) } p \leq n \Rightarrow f(n) \ll \log n.$$
-
8$\begingroup$ I guess that $\omega(n)$ is the number of distinct prime factors of $n$. If $f(n)=p_{m+1}$ is the $(m+1)$-th prime, then $n$ must be divisible by $p_1\cdots p_m$, hence $f(n) \ll m \log m \ll \omega(n) \log \omega(n)$. Your example shows one cannot hope for a better bound. $\endgroup$– François BrunaultCommented Dec 1, 2021 at 19:14
-
1$\begingroup$ While I am not sure if this helps but bounds on average of $f(n)$ have been proven in corollary 3 here. arxiv.org/abs/0912.2508 $\endgroup$– HhhhhhhhhhhCommented Dec 1, 2021 at 19:57
-
1$\begingroup$ @François Brunault: thanks, this is exactly what I was hoping for! $\endgroup$– Dr. PiCommented Dec 1, 2021 at 22:12
-
$\begingroup$ OEIS A053669 gives a very unique closed form expression, which is reproduced below. $$a(n) = 1 + \sum_{k=1}^{n} \left( \left\lfloor \frac{n^k}{k!} \right\rfloor - \left\lfloor \frac{n^k - 1}{k!} \right\rfloor \right)$$ $\endgroup$– NavvyeCommented May 22 at 16:14
-
1$\begingroup$ @GHfromMO I've turned my comment into an answer. $\endgroup$– François BrunaultCommented May 24 at 7:37
2 Answers
If $f(n) = p_{m+1}$ is the $(m+1)$-th prime, then $n$ must be divisible by $p_1 \cdots p_m$, hence $f(n) \ll m \log m \ll \omega(n) \log \omega(n)$. Your example shows one cannot hope for a better bound.
Let $f(n)$ be the least prime not dividing $n$. If $p_k$ is the $k$-th prime, $m\geq 1$ is an integer, and $$q_m = \prod_{k=1}^m p_k,$$ then $f(q_m)=p_{m+1}$. Indeed, $q_m$ is the least positive integer at which $f$ equals $p_{m+1}$, so we find that $f$ is maximized along the sequence of primorials $q_m$.
By the prime number theorem, we have $$q_m = e^{(1+o(1))m\log m},\qquad p_{m+1}=(1+o(1))m\log m.$$ Thus, $$f(e^{(1+o(1))m\log m})=(1+o(1))m\log m.$$ Inverting this relationship, we find that $$f(n) = (1+o(1))\log n$$ when $n$ is a primorial. Since $f$ is maximized along the primorials, we find that $$f(n)\leq (1+o(1))\log n$$ for all $n\geq 2$. Using explicit forms of the prime number theorem, one could bound the $o(1)$ term completely explicitly.
-
$\begingroup$ not sure why you repeated parts of the first post to be honest. $\endgroup$– Dr. PiCommented Dec 1, 2021 at 22:11
-
4$\begingroup$ @Dr.Pi for the sake of having a self-contained answer. $\endgroup$ Commented Dec 1, 2021 at 22:41