Let $p= 13$ and $a = 16$. Show that
$$\sum_{k=1}^{(p-1)/2} \lfloor \frac{a \times k}{p} \rfloor = 23 $$
but $g= 2$ where $g$ is as defined in Gauss’s Lemma. Explain why Lemma (7.20) fails in this case.
The following table shows the calculations which confirm the sum is 23.
| k | floor (16k/13) |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 6 |
| 6 | 7 |
| 23 |
The Lemma is not applicable because it requires $a$ to be odd, but here $a=16$ is even.