def slice_fraction(sequence, i, n):
    """
    Split a sequence in `n` slices and then return the i-th (1-indexed).
    The last slice will be longer if the sequence can't be splitted even-sized or
    n is greater than the sequence's size.
    """
    total = len(sequence)

    per_slice = total // n

    if not per_slice:
        return sequence if i == n else type(sequence)()

    ranges = [[n, n + per_slice] for n in range(0, total, per_slice)]

    # fix last
    if total % n != 0:
        ranges = ranges[:-1]
        ranges[-1][1] = None

    portion = dict(enumerate(ranges, 1))[i]
    return sequence[slice(*portion)]