Formal expression for parity of three integers During an X-Ray Crystal Diffraction course, we ended up with this sum :
$$(-1)^{h+k} + (-1)^{k+l} + (-1)^{h+l} + 1$$
The condition of extinction for the diffraction is that the sum must be equal to 0 :
$$(-1)^{h+k} + (-1)^{k+l} + (-1)^{h+l} + 1 = 0$$
We concluded by saying that this conclusion is met if and only if h,k and l are of different parity, just by trying a few values and coming up with a pattern.
By successive hypothesis on each of the integers, I eventually proved it :

*

*if h is even:

*

*if k is even:

*

*if l is even:
$$(-1)^{h+k} + (-1)^{k+l} + (-1)^{h+l} + 1 = 1 + 1 + 1 + 1 \neq 0$$

*if l is odd:
$$(-1)^{h+k} + (-1)^{k+l} + (-1)^{h+l} + 1 = 1 + (-1) + (-1) + 1 = 0$$



*if k is odd:

*

*if l is even:
$$(-1)^{h+k} + (-1)^{k+l} + (-1)^{h+l} + 1 = (-1) + (-1) + 1 + 1 = 0$$

*if l is odd:
$$(-1)^{h+k} + (-1)^{k+l} + (-1)^{h+l} + 1 = (-1) + 1 + (-1) + 1 = 0$$





*if h is odd:

etc. The condition that h,k and l must be of same parity is proven by checking all possible cases.
However, I don't find this proof elegant. What if the sum was composed of 4, 10, 100 terms? This method quickly becomes impractical.
I was wondering if there was a more formal way to prove the condition. The problem I'm having is I don't know how to put "h,k and l must be of same parity" into an algebraic expression that I could try to find in my initial equation.
I tried manipulating the equation this way :
$$(-1)^{h+k+l}[(-1)^{-l} + (-1)^{-k} + (-1)^{-h}] = (-1)^1$$
But I didn't find any parity property of the sum $h+k+l$, if h,k and l are of same parity, that could help me get a nice algebraic form.
 A: I don't know if this answer will satisfy you, but you don't have to check every case individually. Just use the symmetry of your equation.
You see that switching $h$ with $k$ doesn't change the result, so the case where $k$ and $l$ are even and $h$ odd is the same as $k$ odd and $h,l$ even.
Knowing this you are only left with few expression to evaluate:

*

*$h,k,l$ are all even or odd:
Since the sum of two even number is even, and the sum of two odd is also an even number, you can easily conclude that
$$(-1)^{h+k} + (-1)^{k+l} +(-1)^{h+l} + 1 = 1 + 1 + 1 + 1 \neq 0$$


*The case where only $k$ is odd gives us
$$ (-1)^{odd} + (-1)^{odd} + (-1)^{even} + 1 = -1 -1 + 1 + 1 = 0$$
By symmetry you don't have to check the cases where only $l$ or only $h$ are odd.


*The only case left then is when you have two odd numbers, say $k$ and $l$.
Then
$$ (-1)^{odd} + (-1)^{even} + (-1)^{odd} + 1 = -1 + 1 - 1 + 1 = 0$$
The same symmetry argument says that the result will be the same when you choose $h$ and $k$ to be odd, or $l$ and $h$.
In a sense we haven't done that much less of effort but then if your sum if composed of more and more terms you will see the benefit of exploiting symmetry.
Say you have now 100 terms, $n_1,\dots,n_{100}\in\mathbb{Z}$. With the same kind of sum, i.e.
$$S:= \sum_{i\neq j} (-1)^{n_i + n_j}  \quad+ 1$$
Then using symmetry, you see that only the numbers of even $n_k$ are relevant, not really which one is.
The computation then would require some care but I think you could even further simplify it to knowing only the ratio of odd and even number and this would give directly the results.
