# Determine set of dividend and divisor for quotient

I have the following Problem:

1. I know the range within the results of a division must lie. [ quotientrange ] Additionally, the quotient should not exceed a certain number of fractions.
2. I know, that both dividend and divisor must consist of a certain set of digits. Dividend and divisor are further restricted by a range. Edit: Dividend and divisor are only integers.

My question is: How can I determine a set of dividends and divisors, which satisfis this assumption?

Example:

• Dividend should be within the rage [100.00; 999.99] and only consist of the digits 1, 2, 3, 4, 5
• Divisor should be within the range [10; 99] and only consist of the digits 1, 2, 5.
• Thus, the maximum range of the result is clearly determined by [100.00 / 99; 999.99 / 10]

Question: How can I determine a set [dividend1,dvisor1;....;dividend_n,divisor_n] which satisfies my assumptions?

Brute force is an alternative, certainly, by calculating from an assumed result (the range is known), constructing a valid divisor, performing a multiplication and chcecking, wheater the result satisfies the constraint for the dividend.

However, I wonder if there is a more intelligent approach?

• Are dividend and divisor integers? – Wolfgang Bangerth Aug 20 '12 at 10:46
• No, they need not be. However, they must also not exceed a certain number of decimal places. – JohnDoe Aug 20 '12 at 11:19
• Background: I am trying to automatically assemble dividends and divisors suitable to learn children to divide the pen and paper method. There are certain constraints to the dividend (eg. digits 1 .. 5 easier), divisors (e.g. 1, 2, 5 easier) and the quotient (without decimal places or with fixed set of decimal places, so that the remainder becomes zero) – JohnDoe Aug 20 '12 at 11:28
• By thinking again about your question - yes, the problem can be reduced to be dividend and divisor just integers. – JohnDoe Aug 20 '12 at 11:40
• I see. Then I also see the relation to your other question about drawing random numbers with only certain digits :-) Can I suggest you edit the question to mention that it's only integers? That said, this is more a number theory question that I have little to contribute to... – Wolfgang Bangerth Aug 21 '12 at 0:04