# fun little problem

• Dec 22nd 2008, 12:25 PM
galactus
fun little problem
Here is a good problem if anyone wants to give it a go.

Find the smallest positive integer such that when the first digit is shifted to the end, the result is 3/2 times the original number.

For instance, 1284 becomes 2841. But 2841 is not 3/2 times 1284.

Fermat's Little Theorem may come in handy.

You know, $\displaystyle a^{p-1}\equiv 1(mod \;\ p)$

But, feel free to do it however you like.
• Dec 22nd 2008, 02:15 PM
NonCommAlg
Quote:

Originally Posted by galactus
Here is a good problem if anyone wants to give it a go.

Find the smallest positive integer such that when the first digit is shifted to the end, the result is 3/2 times the original number.

For instance, 1284 becomes 2841. But 2841 is not 3/2 times 1284.

Fermat's Little Theorem may come in handy.

You know, $\displaystyle a^{p-1}\equiv 1(mod \;\ p)$

But, feel free to do it however you like.

this question was asked on SOS over a year ago and this was my solution: let $\displaystyle n=10^{r-1}a_1 + 10^{r-2}a_2 + \cdots + 10a_{r-1} + a_r$ be the smallest such number. we want to have:

$\displaystyle 3(10^{r - 1}a_1 + 10^{r - 2}a_2 + ... + 10a_{r - 1} + a_r) = 2(10^{r - 1}a_2 + 10^{r - 2}a_3 + ... + 10a_r + a_1),$ which after simplifying gives us $\displaystyle (3 \times 10^{r - 1} - 2)a_1 = 17m,$ where $\displaystyle m=10^{r-2}a_2 + 10^{r-3}a_3 + \cdots +10a_{r-1} + a_r.$

so we must have: $\displaystyle 3 \times 10^{r - 1} \equiv 2 \mod 17,$ which after multiplying by $\displaystyle 60,$ gives us: $\displaystyle 10^r \equiv 120 \equiv 1 \mod 17.$ thus $\displaystyle r = 16.$ hence: $\displaystyle 17m = (3 \times 10^{15} - 2)a_1.$ in order to get the smallest number,

we let $\displaystyle a_1 = 1.$ then $\displaystyle m= \frac{3 \times 10^{15} - 2}{17} = 176470588235294.$ therefore: $\displaystyle n=10^{r-1}a_1 +m = 1176470588235294. \ \Box$