Quote:
Originally Posted by axn
which can be simplified to q mod 8 = 1 or 7

No, the 16 values (mod 120) are more restrictive.
+/ 1 (mod 8) would give 30 values (mod 120):
1 7 9 15 17 23 25 31 33 39 41 47 49 55 57 63 65 71 73 79 81 87 89 95 97 103 105 111 113 119