An exponential polynomial formed with the Legendre symbol