infinite sequence problem