MariaDB, SEQUENCE engine, dynamic upper bound
SELECT seq
    FROM seq_0_to_99999999
    WHERE seq BETWEEN 12345678 and 12345688;


works fine and fast.  It returned 11 rows.

A more complex query:

SELECT MIN(FROM_DAYS(seq)) AS first_day,
       MAX(FROM_DAYS(seq)) AS last_day,
       COUNT(*) AS number_of_days
    FROM seq_0_to_99999999
    WHERE seq BETWEEN TO_DAYS('2020-01-01')
                  AND TO_DAYS(CURDATE());


Returned:

+------------+------------+----------------+
| first_day  | last_day   | number_of_days |
+------------+------------+----------------+
| 2020-01-01 | 2020-04-02 |             93 |
+------------+------------+----------------+
1 row in set (0.00 sec)


It, too, was fast, and touched only 94 rows according to the 'Handler_read%' values.  Cf: http://mysql.rjweb.org/doc.php/index_cookbook_mysql#handler_counts

For your case, you may need something like

WHERE seq BETWEEN ...
              AND ( SELECT MAX(...) FROM ... )


I find that the general use of seq is to generate a generous number of values, then let WHERE go for the range I need.  The Optimizer avoids really generating the zillion values I seem to be asking for.  (At least in examples like these.)