# Closed form evaluation of the sum of the Legendre symbol over an interval ?

Let $p$ be a prime with $p \equiv 3 \mod 4$, $p \neq 3$, with its associate Legendre symbol $\left( \frac{.}{p} \right)$, and let $h$ be the class number of $\mathbb{Q} ( i \sqrt{p} )$. If $x \mapsto ((x))$ is the fractional part function, then a well-known formula due to Dirichlet asserts that $$\sum_{x \in \mathbb{F}_p^{\star}} \left(\left( \frac{x}{p} \right)\right) \left( \frac{x}{p} \right) = - h$$

It is perhaps less "well-known" that this allows the exact evaluation of some sums of the form $\Sigma(a,b) = \sum_{ap < x < bp} \left( \frac{x}{p} \right)$ with $0 \leq a < b \leq 1$ : The formula above implies that any function of the form $R : \alpha \mapsto \sum_{\lambda \in \mathbb{Z}} c_{\lambda} \left(\left( \lambda \alpha \right)\right)$ satisfies $$\sum_{x \in \mathbb{F}_p^{\star}} R\left( \frac{x}{p} \right) \left( \frac{x}{p} \right) = S(R) h$$

where $S(R) = -\sum_{\lambda \in \mathbb{Z}} c_{\lambda}\left( \frac{\lambda}{p} \right)$. The choice $R(\alpha) = 2((\alpha)) - ((2 \alpha))$ yields $\Sigma(\frac{1}{2},1) = m_p h$ where $m_p \in \mathbb{Z}$ depends only on $p \mod 8$. Also, $\Sigma(0,\frac{1}{2}) = - m_p h$. Moreover, the choices $R(\alpha) = ((-\alpha)) - ((2 \alpha)) - ((3\alpha)) + ((6\alpha))$, $R(\alpha) = -2((\alpha)) + ((2 \alpha)) + 2 ((3\alpha)) - ((6\alpha))$, and $R(\alpha) = -((\alpha)) + 2((2 \alpha)) - ((3\alpha))$, successively yield the values of $\Sigma(0,\frac{1}{6})$,$\Sigma(\frac{1}{6},\frac{1}{3})$, and $\Sigma(\frac{1}{3},\frac{1}{2})$ (all of the form $m_p h$, with $m_p$ depending only on $p \mod 24$), and thus of $\Sigma(\frac{5}{6},1)$,$\Sigma(\frac{2}{3},\frac{5}{6})$, and $\Sigma(\frac{1}{2},\frac{2}{3})$.

Are there any other value of $a,b$ such that $\Sigma(a,b)$ is known to equal $m_p h$ where $m_p$ depends only on $p$ modulo (some) $D$ ?