Text this: On certain sum involving quadratic residue