Number theoretic generalization of the monster denominator formula