I was looking at the integral $\int_{0}^{1}\lfloor{ax}\rfloor\lfloor{bx}\rfloor dx$. I found this resource for relatively prime $a$ and $b$ and I could follow the solution and simplified it to $\int_{0}^{1}\lfloor{ax}\rfloor\lfloor{bx}\rfloor dx=\frac{ab}{3}-\frac{a}{12b}-\frac{b}{12a}+\color{red}{\frac{1}{12ab}}-\frac{a}{4}-\frac{b}{4}+\frac{1}{4}$. On this MSE question, I saw a solution that held for non-relatively coprime $a$ and $b$: $\int_{0}^{1}\lfloor{ax}\rfloor\lfloor{bx}\rfloor dx=\frac{ab}{3}-\frac{a}{12b}-\frac{b}{12a}+\color{red}{\frac{\gcd(a,b)}{12ab}}-\frac{a}{4}-\frac{b}{4}+\frac{1}{4}$. My intuition told me to replace $a$ with $\frac{a}{c}$ and $b$ with $\frac{b}{c}$ where $c=\gcd(a,b)$ and somehow cancel out the $c$ but it didn't seem to be going anywhere. How can one extend the first solution to get to the second? Why does that single term change and nothing else?
1 Answers
My first answer was very wrong; I've hopefully made amends by changing it to a correct answer, but it's not a complete answer, merely a suggested approach.
The crucial term to evaluate in the first linked resource is $$ \sum_{u=0}^{ab-1} \Bigl\{ \frac ua \Bigr\} \Bigl\{ \frac ub \Bigr\} = \frac1{ab} \sum_{u=0}^{ab-1} (u\mod a)(u\mod b) $$ where $\{y\} = y - \lfloor y\rfloor$ is the fractional part of $y$. In the linked solution they assume that $\gcd(a,b)=1$. Howeever, in general, $(u\mod a)(u\mod b)$ is periodic with period $\mathop{\rm lcm}[a,b] = \frac{ab}{\gcd(ab)}$, and so the sum can be split into $\gcd(a,b)$ equal sums; it's also possible to characterize the pairs $\bigl( u\mod a, u\mod b\bigr)$ that occur, although it's a bit more complicated when $\gcd(a,b)>1$: we only get the ordered pairs where $(u\mod a) \equiv (u\mod b) \pmod{\gcd(a,b)}$.
- 92,241
-
How are you defining periodic? My definition (from Wikipedia) is "A function f is said to be periodic if, for some nonzero constant P, it is the case that $f(x+P)=f(x)$" and this does not seem to be true for $\lfloor ax\rfloor\lfloor bx\rfloor$. – Dylan Levine Sep 11 '24 at 14:20
-
I don't see how this answers my question – Dylan Levine Sep 11 '24 at 14:23
-
Sorry, I was very sloppy ... hopefully fixed now – Greg Martin Sep 11 '24 at 17:07