# What's the smallest number with first digit 1 that triples when this digit is moved to the end?

There's this homework question I have, and while I know people generally don't like these, I would like a hint on how to get started please.

A positive integer begins with the digit 1 when written in decimal. When this digit is transferred to the end of the number, the number is tripled. Find the smallest number that has this property.

I know it has something to do with divisibility by 3. How should I start? Could someone please give an insightful comment that might let me solve it (without feeling like cheating)?

Edit: I suppose that transfer means that 12345 would become 23451...

• What does "transferred to the end of the number" mean? Can you give an example? Jun 16 '15 at 2:55
• How about writing a normal title? Whom will this randomness help? Jun 16 '15 at 4:26
• For completeness, I don't think the community on the whole dislikes homework questions; if you're asking a homework question, we just prefer that you show some degree of effort first. (This is just a general assessment; I'm not making a judgment on this particular post.)
– Ken
Jun 16 '15 at 4:32

$x=1\cdot 10^n + t$, with $t < 10^n$

$y=10t+1 \implies y=3x$

$10t+1 = 3 \cdot 10^n + 3t \implies 7t=3 \cdot 10^n-1$

So the question is: what is the smallest $n$ such that $7$ divides $3 \cdot 10^n-1$ ?

Another way to express this is: how long is the period in $3/7$ when expressed in decimal?

This will give you the smallest $x$.

• Decimal expansions of fractions of the form $a/7$ are fun.
– lhf
Jun 16 '15 at 3:02
• Yeah, given my knowledge of $142857$ and its properties, my personal answer to the OP was "OK $142857$ is an answer, is there a smaller one?" Jun 17 '15 at 1:30
• No, the other way to express this is: how long is the digit sequence in $3/7$ after the decimal point before periodic repetition begins? $t=\frac{3}{7}\cdot 10^n-\frac{1}{7}$ and $\frac{3}{7}=0.42857\overline{142857}$ and $\frac{1}{7}=0.\overline{142857}$, so the least $n$ is $|\{4,2,8,5,7\}|=5$. All integer solutions are given when $n=6k+5,\, k\in\Bbb Z_{\ge 0}$. Jun 17 '15 at 8:13

Here is an alternative more elementary solution (expanding on Rogelios answer):

Let's call the number with the $1$ in the front $a$ and the other one $b$. Then $a \times 3 = b$.

We know that $b$ has a $1$ in its last place so $a$ must have a $7$ in its last place because $7 \times 3 = 21$ is the only product of three which has a $1$ in its last place. So

$a = 7$ and $b = 7 \times 3 =21$

Now the last digit of both numbers is correct. However, if $a$ ends with $7$ then $b$ needs to end with $71$ instead of $21$. So we lack another $50$. How can we get another $50$ into $b$? By adding $50$ to $a$! Because $5 \times 3 = 15$ is the only product of three which has a $5$ in its last place. So

$a = 57$ and $b = 57 \times 3 = 171$

Now the last two digits are correct. However, as above, if $a$ ends with $57$ then $b$ needs to end with $571$ instead of $171$ so we need another $400$. How can we get another 400 into $b$? By adding $800$ to $a$! Because $8 \times 3 = 24$ is the only product of three which has a $4$ in its last place. So

$a = 857$ and $b = 857 \times 3 = 2571$

Now the last three digits are correct. Can you take it from there?

Here's a slightly different solution:

We must have

$$10x + 1 = 3(x+10^k)$$

for some non-negative integers $x$ and $k$. Simplifying, we get

$$7x = 3\times 10^k - 1$$

so

$$3\times 10^k \equiv 1 (\mod 7)$$

or

$$3 ^ {k+1} \equiv 1 (\mod 7)$$

Working mod 7, we have $3^2\equiv2$, $3^3\equiv6$, $3^4\equiv4$, $3^5\equiv5$ and $3^6\equiv1$, so the minimal $k$ is 5.

Thus

$$7x = 3\times10^5-1 = 299,999$$

and $x=42,857$; the numbers are $428,571 = 3 \times 142,857$.

• Ah, I guess this is the same as @lhf above, but presented slightly differently at the end. Jun 16 '15 at 14:05

I guess the last digit is a 7 because only $7 \times 3 =21$ will produce a number which ends with 1. I would start by showing that a two digit number is impossible (17) and then try $1a7$ or $1ab7$ writing the equations in the form (e.g. if it was a 4 digit number):

$$3 \times(1ab7) = ab71$$ From this you can extract information by writing out the decimal expansion, for instance:

$$1ab7 = 1000 + 100 \times a + 10 \times b + 7$$

and try to figure out how $a$ and $b$ are related to