ok....it has to be a 9 digit number, right? and divisible by 7?
so it has to be less than or equal to 999999999 and greater than or equal to 100000000
do this: generate a random number between
100000000/7 = 14285714
and
999999999/7 = 142857142
and multiply by 7. like this:
function my_random_number() {
return 7*rand(14285714, 142857142);
}
if you want to generalize it to make 9-digit numbers divisible by any old number, i leave that exercise up to you! do your homework!
PS: shryku, that's some brutal logic there! damn!