I'm trying to do the same for any prime

.

In my analysis of the situation, multiplying equations 1 to s we'll have:

.

In the link (that contains the proof), the author said "Finally, the right side includes (-1)1+2+…+s. The exponent simplifies to s×(s+1)/2. This is even when s is 3 or 4 mod 4, which means 2 is a quadratic residue iff p = 1 or 7 mod 8. 2 is the square of 6 mod 17, but it isn't the square of anything mod 13."

It's not very clear how the author came to conclude that

is even when s is 3 or 4 mod 4.

Could you shed a little light on that? Thanks.