Words near legendre-symbol in the dictionary