Legendre symbol service