$\sum_{i=0}^k \lfloor\sqrt{ip} \rfloor = \frac{(p^2-1)}{12}$ where p is a prime and $p=4k+1$

344 Views Asked by At

Question: Let p be a prime number of the form 4k+1. Show that

$\sum_{i=0}^k \lfloor\sqrt{ip} \rfloor = \frac{(p^2-1)}{12}$

Source: I came across this question while solving An Introduction to the Theory of Numbers by Niven et al as a part of my reading project. Question number 24 from section 3.2 (Quadratic Reciprocity)

My attempt: I converted the problem into an equivalent problem of proving that the following identity holds:

$\sum_{i=0}^{2k} \lfloor \frac{i^2}{p} \rfloor = \frac{(p-1)^2}{8}-\frac{(p^2-1)}{12}$

The motivation for this was that it is easier to evaluate a sum that involves square as compared to the one involving square root. Now I am stuck and don't know how to proceed. Thanks in advance.

1

There are 1 best solutions below

3
On BEST ANSWER

I will prove your second identity.

Since the prime in consideration is one of the form $4k+1$, you can pair each residue $i^2$ with one another residue, say $(i')^2$ such that $i^2+(i')^2$ is divisible by $p$. It is easy to verify that $\left\lfloor\frac{i^2}{p}\right\rfloor + \left\lfloor\frac{(i')^2}{p}\right\rfloor=\left\lfloor\frac{i^2+(i')^2}{p}\right\rfloor-1$. Thus the sum you want to evaluate is equal to $$\sum_{i=1}^{\frac{p-1}{2}} \dfrac{i^2}{p}-\dfrac{p-1}{4},$$ after which an easy calculation shows that the sum is indeed $\frac{p^2-6p+5}{24}=\frac{(p-1)^2}{8}-\frac{p^2-1}{12}$, and we are done.