Let (p⋅) denote the Legendre symbol. We consider the two integers
M=x=1∑p−1(p1+x4)andN=x=1∑p−1(p1+x8).
Notice that M and N are integers with ∣M∣,∣N∣<p. Also, we contend M≡4(mod8) and N≡0(mod8). For the sum M, there are exactly four residues x with x4=−1, and the remaining residues make 2k−1 groups of four contributing ±4 to the sum. Similarly, in the sum N we have groups of eight contributing 0 or ±8.
On the other hand modulo p we have
M≡x=1∑p−1(1+x4)4k≡(p−1)(2+(2k4k))(modp)
and
N≡x=1∑p−1(1+x8)4k≡(p−1)(2+2(k4k)+(2k4k))(modp).
whence
2M−N≡(k4k)(modp).
Note that 2M−N≡2(mod4) and lies in (−p,p), hence
2M−N∈{±2,±6,…,±(p−3)}.
Consequently r∈{2,3,6,7,10,11,…,p−3,p−2}. In particular, since squares are 0 or 1 mod 4, it follows r is not a square.