The evaluation of lattice sums. II. Number‐theoretic approach