TITLE: How to generate two numbers such that the smaller divides the larger
QUESTION [5 upvotes]: I am creating a children's math game and need an algorithm (that I can write in JavaScript) to generate two numbers such that the smaller always divides the larger. How can I do that?

REPLY [8 votes]: Generate two numbers $a$ and $d$, let $b=ad$ and output $a$ and $b$.

REPLY [4 votes]: Generate two random integers $a$ and $b$. Set the dividend as $ab$ and the divisor as $b$. In this way, you are sure that the divisor evenly divides the dividend and gives the quotient $a$ (i.e. $ab \div b = a$).