Misunderstood the question,so the question is the table should be autoincremented based on parameter..

create proc usp_test1
(
@n int
)
as
begin
if object_id('number','u') is not null
drop table number
create table dbo.number
(
id int
);
with cte
as
(
select 1 as n
union all
select n+1 from cte
where n<@n
)
insert into number
select * from cte c where not exists(select 1 from number n where n.id=c.n)
end

You could also create table only once and comment out table creation script