15

I've found a curious property of the fractional part.

Namely, let be given a number $n$. Then among the numbers

$ n/1, n/2, n/3, .... n/n, $

the proportion of elements whose fractional part is $\geq 1/2$ tends to $2.588\ldots$ as $n$ tends to $\infty$. Here is the Python code that helped me to discover this fact, by giving various values to $n$.

n = 7379491
count = 0
for i in range(1, n):
    if n/i - n//i >= 0.5:
        count += 1

print("{}, {}".format(n, n/count))

Is it something known? what is the rationale behind this?

Greg Martin
  • 92,241
MikeTeX
  • 2,128
  • 12
  • 20
  • 8
    For the record, 2.588 seems to be the inverse of the proportion. – angryavian Dec 19 '23 at 17:48
  • are $n/i=\lfloor \frac ni\rfloor$ and $n//i={\frac ni}$ where ${x}=x-\lfloor x\rfloor$ ? – zwim Dec 19 '23 at 17:48
  • 3
    @zwim n//i is $\lfloor n/i \rfloor$, so that $n/i - \lfloor n/i \rfloor = {n/i}$. – angryavian Dec 19 '23 at 17:53
  • 1
    (+1) , but still the question can be improved. What makes you think that the limit even exist and has about this value ? – Peter Dec 19 '23 at 17:53
  • As I said, I've tried a lot of different numbers, more an more large, and the limit is visible from the results. – MikeTeX Dec 19 '23 at 19:21
  • 3
    See https://oeis.org/A075989, where it is conjectured that the proportion is asymptotically $2 \ln(2) - 1$. That matches your observation since $1/(2 \ln(2) - 1) \approx 2.588699449562$. – Martin R Dec 19 '23 at 19:44
  • 1
    @MartinR This formula $a(n) = (2(\log 2)-1)n + O(n^{1/2})$ was not lead by "conjecture:", so is it a proven fact? OEIS does not give a source it seems – X-Rui Dec 19 '23 at 20:00
  • @X-Rui: You are right, the conjecture is about the lower order terms, not about the leading term. – Martin R Dec 19 '23 at 20:04
  • 1
    @Martin the conjecture is implied by the Dirichlet divisor conjecture while the result with $O(\sqrt n)$ or more generally $O(n^{\alpha+\epsilon})$ for any $\alpha$ that works for divisors (eg $1/2$ by the hyperbola method) is easy to prove as below – Conrad Dec 19 '23 at 21:20

3 Answers3

13

The constant you are looking for is $\frac{1}{2 \ln(2) - 1}$. Here's an explanation; I'm skipping some details here and there but the overall idea should be intact.

  • For $\frac{2}{3} n < k \leq n$, we have $1 \leq \frac{n}{k} < \frac{3}{2} \implies \left\{ \frac{n}{k} \right\} < \frac{1}{2}$;
  • for $\frac{2}{4} n < k \leq \frac{2}{3} n$, we have $\frac{3}{2} \leq \frac{n}{k} < 2 \implies \left\{ \frac{n}{k} \right\} \geq \frac{1}{2}$;
  • for $\frac{2}{5} n < k \leq \frac{2}{4} n$, we have $2 \leq \frac{n}{k} < \frac{5}{2} \implies \left\{ \frac{n}{k} \right\} < \frac{1}{2}$;
  • for $\frac{2}{6} n < k \leq \frac{2}{5} n$, we have $\frac{5}{2} \leq \frac{n}{k} < 3 \implies \left\{ \frac{n}{k} \right\} \geq \frac{1}{2}$;
  • ...

Therefore, the $k$'s we are counting are those satisfying $\frac{2}{2 l} n < k \leq \frac{2}{2l - 1} n$ for some integer $l \geq 2$. The limit of the proportion is then given by $$\begin{split} \sum_{l = 2}^\infty \left( \frac{2}{2 l - 1} - \frac{2}{2 l} \right) &= 2 \left( \frac{1}{3} - \frac{1}{4} + \frac{1}{5} - \frac{1}{6} + \dots \right) \\ &= 2 \underbrace{\left( 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \dots \right)}_{= \ln(1 + 1) = \ln{2}} - \underbrace{2 \left( 1 -\frac{1}{2} \right)}_{= 1} \\ &= 2 \ln(2) - 1 \\ &\approx 0.38629436112. \end{split}$$ This is the value discovered by Benoit Cloitre on the OEIS in 2012 (found by Martin R in the comments). See https://oeis.org/A075989. The $2.588...$ you've found is the inverse of that value, $\frac{1}{2 \ln(2) - 1} \approx 2.58869944956$.

X-Rui
  • 1,622
  • This answer is quite bright! +1 and accepted – MikeTeX Dec 20 '23 at 07:06
  • I don't see what detail is missing from your answer. Can you give me a hint? – MikeTeX Dec 20 '23 at 07:09
  • @MikeTeX Thank you! I'm just usually more thorough than this, like I prove more carefully instead of only demonstrate with examples. But there could be some major gaps in the limit part. The expression for finite $n$ should come before $n \to \infty$, but it is a bit messier, and I might have to control the error terms. So I did it the other way around. More intuitive this way, but technically not rigorous. – X-Rui Dec 20 '23 at 11:04
  • 1
    Please have a look at my other post at https://math.stackexchange.com/questions/4831482/distribution-of-the-fractional-parts-of-n-1-n-2-n-n-as-n-tends-to-infinity where I tried to generalize your answer. – MikeTeX Dec 21 '23 at 10:46
10

Note that ${n/k} \ge 1/2$ iff $[2n/k]-2[n/k]=1$ so if $a(n)$ is the number of such $k \le n$ we have $$a(n)=\sum_{k \le n}([2n/k]-2[n/k])=\sum_{k \le 2n}[2n/k]-n -2\sum_{k \le n}[n/k]$$ since if $n+1 \le k \le 2n$ we have $[2n/k]=1$ and there are precisely $n$ such $k$ to be added and subtracted in the first sum.

But $\sum_{k \le x}[x/k]=D(x)=\sum_{m \le x}\tau(m)=x\log x +(2\gamma-1)x+O(x^{\alpha+\epsilon})$ where $\tau(m)$ is as usual the number of divisors of $m$, $\gamma$ is the Euler constant and $\alpha$ is the Dirichlet divisor problem exponent known to be less than $.32$ as of now and conjectured to be $1/4$ (easy proof by the hyperbola method that $\alpha$ is at most $1/2$ and not that hard to prove is at most $1/3$ either).

So $$a(n)=(2n)\log 2n + (2\gamma-1)(2n)-n -2n \log n -2(2\gamma-1)n+O(n^{\alpha+\epsilon})$$ hence by simplification we get $$a(n)=n(2\log 2 -1)+O(n^{\alpha+\epsilon})$$ so $a(n)/n \to 2\log 2-1$ as noted in the OP

Conrad
  • 31,769
  • Thank you so many for this very informative answer. While the other answer exactly and brightly solve the problem, I have learnt a lot from your answer. – MikeTeX Dec 20 '23 at 07:07
  • Could you provide a source where to find that $\sum_{k\leq x} [x/k] = \sum_{m\leq x}\tau (m) = x \log x + (2\gamma -1) x + O(x^{\alpha+\epsilon})$. thx. – MikeTeX Dec 22 '23 at 12:40
  • The first equality is just writing $[x/k]=\sum_{1\le q \le x/k} 1$ and switching sums and counting each appearance, while the second is just the hyperbola method ($pq=m$ means at least one of $p,q$ is at most $\sqrt m$ so instead of counting all divisors, one can count twice only the divisors less than $\sqrt m$ taking care of the case $m$ square and is found in most books on number theory - Hardy and Wright should have it – Conrad Dec 22 '23 at 12:58
0

Fore those interested in questions of this kind and much more, I recommend the article limit problems of probabilistic nature

MikeTeX
  • 2,128
  • 12
  • 20