Perhaps I am just being dense about it, but how do u guarantee that the generated values aren't conflicting with the requirements? Considering the that the second number generated has to be compared to the first in order to find out if it is valid.

I guess I am just having problems seeing how to accomplish the goal that the OP wanted without using a loop of some kind, whether it is a for, do or while. I wouldn't mind being enlightened.