6
$\begingroup$

Given an integer, n, find the smallest integer m such that is divisible by n (i.e.n, is a factor of m ) and satisfies the following properties:

  1. m must not contain zeroes in its decimal representation.
  2. The sum of m's digits must be greater than or equal to the product of m's digits. Given n, find the number of digits in m's decimal representation.

Note: n is not divisible by 10.

How should I derive the Recurrence Relation for this problem?

My approach: Suppose the n = 32, I am multiplying n by 1,2,3... and checking for the number at the units place if the number at the unit's place is greater than the largest digit of n and the number at the tens digit is greater than smallest digit of n then I ignore the m generated and move to the next multiplication.

I am not able to come up with the recurrence relation for doing this operation. Please Help! Thanks!

  • 0
    In your example, assuming 2-digit m are ruled out, then since m is even, 3-digit m must terminate in 4 if both of its first two digits = 1, or in 2 if only one of the first two digits = 1. Only one in five multiples of 32 ends in 2: 192, 352, 512, 672, 832, 992; and one in five ends in 4: 224, 384, 544, 704, 864. None meets the conditions on m. 4-digit m must have three 1's, or two 1's and 2,3 or 2,4 for the other two digits, since the product can't be > 8. So again the terminal digit is 2 or 4: 1152, $1312$... $1312$ is the least m for n = 32. Is there a method in here somewhere?2017-02-03

0 Answers 0