# Space of functions f such that the number of primes in $[x, x+f(x)]$ remains bounded

Given a positive integer $n$ , let $S_{b}(n)$ the set of functions $f$ fulfilling the following conditions :

1) $f$ is continuous, positive and increasing on $(n,+\infty)$

2) for all $x>n$ , the interval $I_{f}(x) : =[x, x+f(x)]$ contains at least one prime number

3) the number of primes in $I_{f}(x)$ remains bounded as $x$ tend to $+ \infty$ .

Is $S_{b}(n)$ closed under both finite sums and products ? Have similar spaces of functions been studied in prime number theory so far ? Any references (not under a paywall, please) ?

• One can also see no such function exists since there are large gaps between primes (of order bigger than \log n) occasionally, so that such a function f would have to be asymptotically bigger than \log n; then by the prime number theorem on average the interval (n,n+f(n)) contains a growing number of primes. In fact, the condition you put is incredibly restrictive; most sequences don't allow any such function. It's equivalent to having no gaps asymptotically bigger than the average and no dense spots. The primes (and any reasonable random sequence) have both. – user36212 Jul 14 '17 at 20:32

There is no such function $f(x)$. First, the prime number theorem implies that the average gap between two primes $p_{n}$ and $p_{n+1}$ is about $\log p_{n}$ and for this reason, if $f(x)$ is smaller than $\log(x)$, then your condition (2) will fail.
On the other hand, Theorem 3.2 from Maynard's paper "Dense clusters of primes in subsets" (published in Compositio Mathematica in 2016) states that for any $x$ and $y$ there are (a lot) of integers $x_{0} \in [x,2x]$ so that $$\pi(x_{0} + y) - \pi(x_{0}) \gg \log y.$$ It follows from this that if $f(x) \to \infty$, then there are $x$ so that the interval $[x, x+f(x)]$ contains arbitrarily many primes, violating your condition (3).
• $f(x)\to \infty$ would also follow from 1, 2, and the elementary fact that there are arbitrarily large gaps between consecutive primes – Pietro Majer Jul 14 '17 at 17:55
If there was such a function $f(x)$ that did work in some sense (see below) then it would increase to infinity (but not too swiftly) with $n.$ So in $[n,n+f^2(n)]$ there would be close to $f(n)$ primes on average, or at least more than $\sqrt{f(n)}.$
For "in some sense" change it to "on average" the number of primes is at least one/bounded OR instead of the actual primes use a sequence of integers with the right densitybut less variation: perhaps one such than in each interval $[x,x+10\log{x}]$ there are on average $10$ members and never less than $5$ or more than $15.$