Consider the double sum $$\sum_{m=1}^p\sum_{n=1}^p\exp(2\pi ik(m^2-n^2)/p).$$
To simplify this, a textbook that I'm using suggests the change of variable $m=n+h$ to get $m^2-n^2=2nh+h^2$, and
$$\sum_{h=1}^p\exp(2\pi i kh^2/p)\sum_{n=1}^p\exp(4\pi ikhn/p).$$
Shouldn't the lower bound for $h$ be $1-p$ rather than $p$? Many thanks!