Sums, Integrals, and Counting