interval sequence calculation, with unit test