You can generate the second number in B2:

=RANDBETWEEN(1,10)

And create the first number in A2:

=RANDBETWEEN(1,10)*B2