  We show that the generating series of Euler characteristics of Hilbert
schemes of points on any algebraic surface with at worst $A_n$-type
singularities is described by the theta series determined by integer valued
positive definite quadratic forms and the Dedekind eta function. In particular
it is a Fourier development of a meromorphic modular form with possibly half
integer weight. The key ingredient is to apply the flop transformation formula
of Donaldson-Thomas type invariants counting two dimensional torsion sheaves on
3-folds proved in the author's previous paper.
