4
$\begingroup$

Let $\frac{p}{q}$ be a positive (reduced) rational. Define $f_{p/q}(k) = 2 \{ \frac{p(k-1)}{q} \} - \{ \frac{pk}{q} \} - \{ \frac{p(k-2)}{q} \}$ for $2 \leqslant k \leqslant q-1$ and $f_{p/q}(q) = 2 \{ \frac{p(q-1)}{q} \} - \{ \frac{p(q-2)}{q} \} - 1$, where $\{ \cdot \}$ denotes the fractional part function. I've tested the following conjecture to many millions of combinations of $p$ and $q$, and it appears to hold:

For any positive rational $\frac{p}{q}$, one has $f_{p/q}(2), \dots, f_{p/q}(q-1), f_{p/q}(q) \in \{-1,0,1\}$.

Is there an obvious proof of this supposed fact?

Update: I've plotted one example below ($k = 3$, blue = $-1$, white $= 0$, orange $= 1$).

MatrixPlot[ Table[k = 3; 2 FractionalPart[p (k - 1)/q] - FractionalPart[p (k - 2)/q] - FractionalPart[p k/q], {p, 1, 1000}, {q, 1, 1000}]

enter image description here

2 Answers 2

4

Show that $f_{p/q}(k) \in (-2,2)$. (Why? since $\{x\} \in [0,1)$)

Next show that it is an integer using the fact that $\{x\} = x - \lfloor x \rfloor$ and $2 \left( \frac{p(k-1)}{q} \right) = \frac{pk}{q} + \left( \frac{p(k-2)}{q} \right).$

Hence, conclude that $f_{p/q}(k) \in \{-1,0,1\}$.

1

I guess it is because $2(k-1)\frac{p}{q}=k\frac{p}{q}+(k-2)\frac{p}{q}$and$\{x\}=x\mod 1$