Legendre symbols