seq関数を実装．