def cell_indices(cell_number: int) -> tuple[int, int]:
    """Return the row and column index tuple (i, j) corresponding to a cell number."""
    if cell_number < 1 or cell_number > 9:
        raise ValueError(f'cell number must be between 1 and 9: {cell_number}')

    i: int = (cell_number - 1) // 3
    j: int = (cell_number - 1) % 3

    return i, j