A simple, brute force way to tell whether a number is a quadratic residue mod p is to square all the numbers from 1 to p − 1 and see if any of the results equals your number.
It's well known that there are no four squares in arithmetic progression among the integers, but there does exist a non-trivial arithmetic progression of four or more squares (i.e., quadratic residues) modulo p for each prime p greater than 11.
Prove that for every oriented graph, D, there exists a vertex whose out-degree at least doubles when you square the oriented graph. For an algorithm to create this squaredgraph, one begins by taking a list of the vertices.
In both cases, graphs of the left hand side and right hand side drawn on the same diagram will reveal the number of intersections of the graphs (and so the number of solutions to the equation)