We study the maximum function of any R+-rational formal series S in two commuting variables, which assigns to every integer n N, the maximum coefficient of the monomials of degree n. We show that if S is a power of any primitive rational formal series, then its maximum function is of the order (nk/2 n ) for some integer k -1 and some positive real . Our analysis is related to the study of limit distributions in pattern statistics. In particular, we prove a general criterion for establishing Gaussian local limit laws for sequences of discrete positive random variables.