import itertools


def ctr(upper):
    """Return a generator for a rollover counter.

    :param int upper: Upper bound of counter.
    """
    return (i for _ in itertools.count() for i in range(1, upper))