The "and" and "or" generating function