I have started to work on some coding problem in Java, but got stuck in between. The problem is illustrated below. We have chosen a number that acts as divisor and its last digit is 3; for example, 3, 13, 33, 203, etc. Now, we need to find the lowest possible dividend that can be divided by the divisor and all its digits are 1's. For Example:
we have a divisor as 3 so least dividened will be 111 only.
If we have divisor as 3 and choose divided as 1 then 1%3 !=0
If we have divisor as 3 and choose divided as 11 then 11%3 !=0
If we have divisor as 3 and choose divided as 111 then 111%3 ==0
So 111 will be least dividend which can be divided by 3.
Now, I have developed some code that can find the lowest dividend when it is contained in the range of Java data type. The problem is when we have to find a dividend that falls out of this range. For example: we have 643 as divisor and we need to find the lowest dividend (which having only 1's) is divisible by 643.
I appreciate your help guys if you can suggest me something.