examples of how to compute the legendre symbol