# fun little problem

• December 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, $a^{p-1}\equiv 1(mod \;\ p)$

But, feel free to do it however you like.
• December 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, $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 $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:

$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 $(3 \times 10^{r - 1} - 2)a_1 = 17m,$ where $m=10^{r-2}a_2 + 10^{r-3}a_3 + \cdots +10a_{r-1} + a_r.$

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

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