# Homework Help: Prove that the sum of the Legendre symbol of pairs of consecutive integers is -1.

1. Oct 31, 2011

### Vespero

1. The problem statement, all variables and given/known data

Prove the formula
$$\sum_{a=1}^{p-2} \left(\frac{a(a+1)}{p}\right) =\ -1$$

2. Relevant equations

$\left(\frac{xy}{p}\right) = \left(\frac{x}{p}\right) \left(\frac{y}{p}\right)$

$\left(\frac{x}{p}\right) \equiv x^{\frac{p-1}{2}}\ (mod\ p)$ (Euler's Criterion)

and other basic properties of modular arithmetic and the Legendre symbol.

3. The attempt at a solution

For the first few p's, I calculated the values of the terms as

p=5 => 2,1,2
p=7 => 2,6,5,6,2
p=11 => 2,6,1,9,8,9,1,6,2
p=13 => 2,6,12,7,4,3,4,7,12,6,2

There is symmetry resulting from the fact that $P = \{1, 2, ..., (p-2), (p-1)\}$ can be rewritten as $P = \{1, 2, ..., \frac{p-1}{2}, -\frac {p-1}{2}, ..., -2, -1\}$.

Could I somehow show that the number of consecutive quadratic residues and consecutive quadratic nonresidues (which would each produce a quadratic residue and thus a Legendre symbol of 1 when multiplied together) is one less than the number of pairs containing a quadratic residue and a quadratic nonresidue together (which would produce a quadratic nonresidue and thus a Legendre symbol of -1 when multiplied together?