What is the least number of digits in $n$?

301 Views Asked by At

A positive integer $n$ is multiplied by $7$. The resulting product contains just one digit repeated several times, and that digit is not $7$. What is the least number of digits in $n$?

I can only think of solving this question by brute force. Is there a better way?

3

There are 3 best solutions below

5
On

You can assume by minimality of $n$ that the digit in $7n$ is 1. And 111111 is divisible by 7, so $n=15873$ and the number of digits is 5.

0
On

We know that $7n = \underbrace{dd\ldots dd}_{k \ \text{digits}}$. Hence, $7n \cdot \dfrac{9}{d} = \underbrace{99\ldots 99}_{k \ \text{digits}} = 10^k-1$.

Since $d$ is not $7$, you know that $7n \cdot \dfrac{9}{d} = 10^k-1$ must be divisible by $7$.

Can you determine the smallest positive integer $k$ such that $10^k-1$ is divisible by $7$? Once you do this, coming up with a value for $d$ and $n$ will be easy.

Once you check that the smallest such $k$ is $6$, then you have $7n = dddddd = d \cdot 111111$. To minimize $n$, pick $d = 1$, which gives $n = 15873$.

0
On

Let assume that $7\times n = aa\dots a = a\times \underbrace{11\dots 1}_{k \mbox{ times}} = a \times \frac{10^k-1}{9}$.

Because $a \neq 7$, so we must find $k$ such that $10^k-1$ is divided by 7. By Fermat's little theorem, we have $10^6-1$ is divided by 7. Som the minimum of k is less than 6. So, we have the least number of $n$ is 5 (111111/7=15873).