Sum[DirichletCharacter[21, 1, i] PowerMod[i, -2, 21], {i, 1, 21}]