  Given a reduced effective divisor D on a smooth variety X, we describe the
generating function for the classes of the Hodge ideals of D in the
Grothendieck group of coherent sheaves on X in terms of the motivic Chern class
of the complement of the support of D. As an application, we compute the
generating function for the Hilbert series of Hodge ideals of a hyperplane
arrangement in terms of the Poincare polynomial of the arrangement.
