equation sequence solver