need help coding a while or for loop

i've tried many approaches but none work well enough,

here is psuedocode of what i'm trying to do...

var intMax = 3;

var intStart = 0;

var intStop = 10;

var arrPicks = [];

for( var i = 0; i < 1000; i++ ){

//1. pick a random number from [intStart] to [intStop]

//2. add the random number to arrPicks but only if it is unique

//3. once i have intMax unique number between [intStart] and [intStop]

//4. use document.write() to write each of the numbers to the screen

//5. increase intStart and intStop by 10 each

}

if intMax = 5, then is should get 5 unique numbers between 0 and 10, then another 5 unique numbers between 10 and 20, etc

like this...

0

3

7

8

9

.

.

.

11

15

18

17

13

.

.

.

20

25

28

23

24

note: i should get exactly 5 unique number all the way up to 1000, they don't have to be in numerical order, but there must be 5 or whatever intMax numbers returned.

so if intMax is 3, i should get 3 x 100 = 300 unique numbers,

if intMax is 7 i should get 7 x 100 = 700 unique numbers

i'm thinking a while loop would be ideal since it could keep trying until it has found for example 3 unique for every block of 10 numbers, and it can document.write() to the screen after each unique number and discard duplicates.

i'll adjust the script to add leading zeros i.e. 005,023,etc as each number must be 3 digits.

my end goal is to pick x amount of numbers from every 10 numbers between 000 and 999.

can somebody please assist with the code, i can easily understand the code and modify it, but this one is eluding me,

and i need this code asap.

thanks for assisting!