The natural numbers $t{}$ and $q{}$ are given. For an integer $s{}$, we denote by $f(s)$ the number of lattice points lying in the triangle with vertices $(0;-t/q), (0; t/q)$ and $(t; ts/q)$. Suppose that $q{}$ divides $rs-1{}$. Prove that $f(r) = f(s)$.
Problem
Source: Russian TST 2021, Day 8 P2
Tags: number theory, lattice points
starchan
01.04.2023 17:15
I swear, this is the most random result I have ever seen.
We extend the definition of $f$ for $t \geq 0$ by defining $f(s) = 1$ when $t = 0$. First, let us try to derive an exact expression for $f(s)$. When is a lattice point $(x, y)$ inside the triangle with vertices so and so? Well, firstly $x$ is nonnegative. Second, the height $y$ must satisfy $(s+1)x-t \leqslant qy \leqslant (s-1)x+t$. Observe that this bound, as a corollary also forces $x \leqslant t$. From here, it follows plainly that \[f(s) = \sum_{x = 0}^{t} \left( \left\lfloor \frac{(s-1)x+t}{q} \right\rfloor - \left\lceil \frac{(s+1)x-t}{q} \right \rceil + 1 \right) \]We will show that $f(s) = f(r)$ whenever $sr \equiv 1 \pmod q$ and $s, r$ are positive integers. Note that this is sufficient to handle things for $s < 0$ or $r < 0$ because $f$ is periodic modulo $q$. Fix any such $s, r, q$. We need to show that: \[\sum_{x = 0}^{t} \left( \left\lfloor \frac{(s-1)x+t}{q} \right\rfloor - \left\lceil \frac{(s+1)x-t}{q} \right \rceil + 1 \right) = \sum_{x = 0}^{t} \left( \left\lfloor \frac{(r-1)x+t}{q} \right\rfloor - \left\lceil \frac{(r+1)x-t}{q} \right \rceil + 1 \right)\]or equivalently \[\sum_{x = 0}^{t} \left( \left\lfloor \frac{(s-1)x+t}{q} \right\rfloor - \left\lceil \frac{(s+1)x-t}{q} \right \rceil \right) = \sum_{x = 0}^{t} \left( \left\lfloor \frac{(r-1)x+t}{q} \right\rfloor - \left\lceil \frac{(r+1)x-t}{q} \right \rceil\right) \qquad (1)\]
The crucial idea is to now induct on $t$! In the base case, $t = 0$, everything is clear. Consider some $t > 0$ now. Let us define some new notation for the sake of brevity. We let $1_{n}$ for a positive integer $n$ denote the truth about $q \mid n$, that is $1_n = 1$ if and only if $q \mid n$, it is $0$ otherwise. From the inductive hypotheses we know that \[\sum_{x = 0}^{t-1} \left( \left\lfloor \frac{(s-1)x+t-1}{q} \right\rfloor - \left\lceil \frac{(s+1)x-t+1}{q} \right \rceil + 1 \right) = \sum_{x = 0}^{t-1} \left( \left\lfloor \frac{(r-1)x+t-1}{q} \right\rfloor - \left\lceil \frac{(r+1)x-t+1}{q} \right \rceil + 1 \right) \qquad (2)\]
Observe that in $(1)$, when $x = t$ both the sides are obviously equal since $q \mid st$ if and only if $q \mid rt$ ($\gcd(s, q) = \gcd(r, q) = 1$). So we can restrict the sum from $x = 0$ to $t-1$. Now we subtract $(2)$ from $(1)$. Using the fact that $\lfloor n/q \rfloor - \lfloor (n-1)/q \rfloor = \lceil (n+1)/q \rceil - \lceil n/q \rceil = 1_n$ we are left with proving the following: \[\sum_{x = 0}^{t-1} \left(1_{(s-1)x+t} + 1_{(s+1)x-t}\right) = \sum_{x = 0}^{t-1} \left(1_{(r-1)x+t} + 1_{(r+1)x-t}\right) \qquad (3)\]Observe that in the above sum, we can safely extend to $x = t$ since obviously both sides increase by the same amount when adding $x = t$. We can write \[\sum_{x = 0}^{t} 1_{(s-1)x+t} = \sum_{x = 0}^{t} 1_{(s-1)(t-x)+t} = \sum_{x = 0}^{t} 1_{r(s-1)(t-x)+rt} = \sum_{x = 0}^{t} 1_{(1-r)(t-x)+rt} = \sum_{x = 0}^{t} 1_{(r-1)x+t}\]Similarily, $\sum_{x = 0}^{t} 1_{(s+1)x+t} = \sum_{x = 0}^{t} 1_{(r+1)x+t}$. Summing these equalities, we obtain exactly $(3)$ and the proof is over by induction on $t$. $\square$
gvole
04.06.2024 14:21
You can just use Pick's theorem... Counting the number of lattice points on the edges is trivial.