(self)
return res
r"""Return the derived series for the group.

        The derived series for a group ``G`` is defined as
        ``G = G_0 > G_1 > G_2 > \ldots`` where ``G_i = [G_{i-1}, G_{i-1}]``,
        i.e. ``G_i`` is the derived subgroup of ``G_{i-1}``, for
        ``i\in\mathbb{N}``. When we have ``G_k = G_{k-1}`` for some
        ``k\in\mathbb{N}``, the series terminates.

        Returns
        =======

        A list of permutation groups containing the members of the derived
        series in the order ``G = G_0, G_1, G_2, \ldots``.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import (SymmetricGroup,
        ... AlternatingGroup, DihedralGroup)
        >>> A = AlternatingGroup(5)
        >>> len(A.derived_series())
        1
        >>> S = SymmetricGroup(4)
        >>> len(S.derived_series())
        4
        >>> S.derived_series()[1].is_subgroup(AlternatingGroup(4))
        True
        >>> S.derived_series()[2].is_subgroup(DihedralGroup(2))
        True

        See Also
        ========

        derived_subgroup
r"""Return the derived series for the group.
r Return the derived series for the group .
def derived_series(self):
        r"""Return the derived series for the group.

        The derived series for a group ``G`` is defined as
        ``G = G_0 > G_1 > G_2 > \ldots`` where ``G_i = [G_{i-1}, G_{i-1}]``,
        i.e. ``G_i`` is the derived subgroup of ``G_{i-1}``, for
        ``i\in\mathbb{N}``. When we have ``G_k = G_{k-1}`` for some
        ``k\in\mathbb{N}``, the series terminates.

        Returns
        =======

        A list of permutation groups containing the members of the derived
        series in the order ``G = G_0, G_1, G_2, \ldots``.

        Examples
        ========

        >>> from sympy.combinatorics.named_groups import (SymmetricGroup,
        ... AlternatingGroup, DihedralGroup)
        >>> A = AlternatingGroup(5)
        >>> len(A.derived_series())
        1
        >>> S = SymmetricGroup(4)
        >>> len(S.derived_series())
        4
        >>> S.derived_series()[1].is_subgroup(AlternatingGroup(4))
        True
        >>> S.derived_series()[2].is_subgroup(DihedralGroup(2))
        True

        See Also
        ========

        derived_subgroup

        """
        res = [self]
        current = self
        next = self.derived_subgroup()
        while not current.is_subgroup(next):
            res.append(next)
            current = next
            next = next.derived_subgroup()
        return res
def derived_series ( self ) : res = [ self ] current = self next = self . derived_subgroup ( ) while not current . is_subgroup ( next ) : res . append ( next ) current = next next = next . derived_subgroup ( ) return res