The first condition by itself is easy - try a=1.

[Something seems wrong if both conditions must hold at the same time - try r=7. The numbers mod 7 are 1,2,3,4,5,6 whose quadratic residues are:

1,4,2,2,4,1 and it doesn't look like any of them satisfy your 2 conditions.]

Ignore the above - misinterpreted the Legendre symbol.