@staticmethod
def _is_restricted_growth_function(sequence):
    """
        Is true when ``sequence`` is a restricted growth function.

        ..  container:: example

            Is true when sequence is a restricted growth function:

            >>> abjad.Enumerator._is_restricted_growth_function([1, 1, 1, 1])
            True

            >>> abjad.Enumerator._is_restricted_growth_function([1, 1, 1, 2])
            True

            >>> abjad.Enumerator._is_restricted_growth_function([1, 1, 2, 1])
            True

            >>> abjad.Enumerator._is_restricted_growth_function([1, 1, 2, 2])
            True

        ..  container:: example

            Is false when sequence is not a restricted growth function:

            >>> abjad.Enumerator._is_restricted_growth_function([1, 1, 1, 3])
            False

            >>> abjad.Enumerator._is_restricted_growth_function([17])
            False

        A restricted growth function is a sequence ``l`` such that
        ``l[0] == 1`` and such that ``l[i] <= max(l[:i]) + 1`` for
        ``1 <= i <= len(l)``.

        Returns true or false.
        """
    try:
        for i, n in enumerate(sequence):
            if i == 0:
                if not n == 1:
                    return False
            elif not n <= max(sequence[:i]) + 1:
                return False
        return True
    except TypeError:
        return False
