Reorder missing numbers in a sequencein two different tables using MySQL This is an extended question of reorder/ fill missing value in a sequence

I have a table "number" having a column "n" which is of type int. I inserted some values like,

n
--
1
3
5
9
11


i also have another table "num" having column "n" which is of type int. I inserted some values like,

n
--
7
12
15
23


Now I want the column n of "number" table as 1,2,3,5,6 and column n of "num" table as 4,7,8,9. That is 1 should be as 1, 3 as 2, 5 as 3, 7 from "num" table as 4 and 9 as 5 and so on. The values of column n should be reordered with the missing values on both the tables.
drop procedure IF EXISTS ALTERTABLEVALUES;
delimiter $$
CREATE PROCEDURE ALTERTABLEVALUES()
BEGIN
DECLARE finished INT DEFAULT 1;
DECLARE total_count INT DEFAULT 1;
DECLARE val varchar(5);
DECLARE i INT DEFAULT 1;
DECLARE table_num INT;
DECLARE table_tab varchar(5);
DECLARE number_cursor CURSOR FOR select num,tab from tempnumbers;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished = 0;

drop temporary table if exists tempnumbers;
CREATE TEMPORARY TABLE tempnumbers as
select num,'temp' as tab from numbers union select num,'audit' as tab from numbers1 order by num;
SET val = (select num from tempnumbers limit 1);
SET total_count = (select count(*) from tempnumbers);

OPEN number_cursor;
get_values: LOOP
FETCH number_cursor INTO table_num,table_tab;
IF finished = 0 THEN 
 LEAVE get_values;
 END IF;
IF table_tab = 'temp' THEN 
    update numbers set numbers.num = val where numbers.num = table_num;
ELSE
    update numbers1 set numbers1.num = val where numbers1.num = table_num;
END IF;
SET val = val +1;
END LOOP get_values;
CLOSE number_cursor;
DROP TEMPORARY TABLE tempnumbers;
END;
$$
delimiter ;

After running the procedure I got numbers table as
n
--
1
2
3
5
6

and numbers1 table as 

n
--
4
7
8
9

This is how i expected for the result.