We provide a systematic method to compute arithmetic sums including some previ- ously computed by Alaca, Besge, Cheng, Glaisher, Huard, Lahiri, Lemire, Melfi, Ou, Ramanujan, Spearman and Williams. Our method is based on quasimodular forms. This extension of modular forms has been constructed by Kaneko and Zagier.