Long-term temporal correlations in time series in a form of an event sequence have been characterized using an autocorrelation function that often shows a power-law decaying behavior. Such scaling behavior has been mainly accounted for by the heavy-tailed distribution of interevent times, i.e., the time interval between two consecutive events. Yet, little is known about how correlations between consecutive interevent times systematically affect the decaying behavior of the autocorrelation function. Empirical distributions of the burst size, which is the number of events in a cluster of events occurring in a short time window, often show heavy tails, implying that arbitrarily many consecutive interevent times may be correlated with each other. In the present study, we propose a model for generating a time series with arbitrary functional forms of interevent time and burst size distributions. Then, we analytically derive the autocorrelation function for the model time series. In particular, by assuming that the interevent time and burst size are power-law distributed, we derive scaling relations between power-law exponents of the autocorrelation function decay, interevent time distribution, and burst size distribution. These analytical results are confirmed by numerical simulations. Our approach helps to rigorously and analytically understand the effects of correlations between arbitrarily many consecutive interevent times on the decaying behavior of the autocorrelation function.