Script to generate a list of number

How can I generate a list of numbers and place all of these numbers in a line-by-line into a file.
I am new to scripting actually.

0501000000 to 0509999999
i.e.
0501000000
0501000001
......
0509999999

set 02
0551000000 to 0559999999
i.e.
0551000000
0551000001
......
0559999999

Please help.

Homework? If not, where's the question, and what have you tried so far?

sorry for the mistake. I have edited and help is relly required.

If you post homework, at least be smart enough not to post it from an university computer. The forum for homework is here, Special Rules apply.