Thursday, 6 August 2026

Exercise (7.4).8

Determine

$$ \sum_{k=1}^{(q-1)/2} \lfloor \frac{k \times p}{q} \rfloor + \sum_{k=1}^{(p-1)/2} \lfloor \frac{k \times q}{p} \rfloor $$

for the primes $p= 17$ and $q= 13$. Also interpret your answer geometrically by counting the lattice points above and below the line $y=\frac{q}{p}x$.


For $p= 17$ and $q= 13$, we have

$$ \begin{align} \sum_{k=1}^{6} \lfloor \frac{k \times 17}{13} \rfloor + \sum_{k=1}^{8} \lfloor \frac{k \times 13}{17}  \rfloor & = \lfloor \frac{17}{13} \rfloor + \lfloor \frac{34}{13} \rfloor  +  \lfloor \frac{51}{13} \rfloor +  \lfloor \frac{68}{13} \rfloor  +  \lfloor \frac{85}{13} \rfloor  +  \lfloor \frac{102}{13} \rfloor \\ \\ & +  \lfloor \frac{13}{17} \rfloor +  \lfloor \frac{26}{17} \rfloor +  \lfloor \frac{39}{17} \rfloor +  \lfloor \frac{52}{17} +  \lfloor \frac{65}{17} \rfloor +  \lfloor \frac{78}{17} \rfloor +  \lfloor \frac{91}{17} \rfloor +  \lfloor \frac{104}{17} \rfloor \\ \\ & = (1 + 2 + 3 + 5 + 6 + 7) + (0 + 1+2+3+3+4+5+6) \\ \\ & = 24 + 24 = 48  \end{align}$$

Alternatively we can use Eisenstein's Lemma (7.19)

$$ \sum_{k=1}^{6} \lfloor \frac{k \times 17}{13} \rfloor + \sum_{k=1}^{8} \lfloor \frac{k \times 13}{17}  \rfloor = (\frac{13-1}{2}) \times (\frac{17-1}{2}) = 6 \times 8 = 48 $$


The following graph (link) illustrates the lattice points above and below the line $y=\frac{13}{17}x$. 

We can see that below the line there are columns of lattice points of heights 1, 2, 3, 3, 4, 5, 6, corresponding to the calculation above.

Similarly, above the line there are rows of lattice points of length 1, 2, 3, 5, 6, 7, also corresponding to the calculation above.

However we count the lattice points, the total is $8 \times 6 = 48$.