This is a program written in C++ that solves and expands upon this discrete math problem:
For some prime numbers p, the equation x * x + 1 = 0 (mod p) has a solution in ℤp. For other primes it does not. For example, in ℤ17 we have 4 * 4 + 1 = 0 (mod 17), but in ℤ19 there is no solution.
Investigate the first several (say, to 103) prime numbers p and divide them into two categories: those for which x * x + 1 = 0 (mod p) has a solution in the equivalence class of p and those for which it does not.