def n_ary_mask(d, n, offset):
    """Create a n-ary mask with n entries (a list of bool with each nth entry True)

    Parameters
    ----------
    d: int
        numbers of entries in the mask
    n: int
        period of the mask
    offset: int
        offset of the True entries

    Returns
    -------
    list of bool
        True/False mask with each nth entry True
    """
    return [(i + offset) % n == 0 for i in range(d)]