Multiplication Or Rearrangement

What is the smallest number that, when multiplied by 4, is simply the original number with the rightmost digit moved to the front of the number?

As an explicit example, if we replace the number 4 with 5 above, then we have 5 × 142857 = 714285 5\times142857=714285 .

(Note that here I multiplied by 5, while the question asks for a number that works when multiplied by 4.)

Note: Don't consider numbers with leading zeroes.


The answer is 102564.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Steven Yuan
Sep 1, 2015

Let N = a 1 a 2 a 3 a n N = \overline{a_1 a_2 a_3 \cdots a_n} be the number we are trying to find. We can write the condition in the problem as

4 a 1 a 2 a 3 a n = a n a 1 a 2 a n 1 . 4\overline{a_1 a_2 a_3 \cdots a_n} = \overline{a_n a_1 a_2 \cdots a_{n-1}}.

Let A = a 1 a 2 a 3 a n 1 A = \overline{a_1 a_2 a_3 \cdots a_{n - 1}} and B = a n B = a_n . We have

4 ( 10 A + B ) = 1 0 n 1 B + A 40 A + 4 B = A + 1 0 n 1 B 39 A = B ( 1 0 n 1 4 ) 39 ( a 1 × 1 0 n 2 + + a n 1 ) = a n ( 1 0 n 1 4 ) . \begin{aligned} 4(10A + B) &= 10^{n - 1} B + A \\ 40A + 4B &= A + 10^{n - 1} B \\ 39A &= B(10^{n - 1} - 4) \\ 39(a_1 \times 10^{n - 2} + \cdots + a_{n - 1}) &= a_n(10^{n - 1} - 4). \end{aligned}

Now, since a n a_n and 1 0 n 1 4 10^{n - 1} - 4 are both integers, we must have that a n ( 1 0 n 1 4 ) a_n(10^{n - 1} - 4) divides 39 39 . This is equivalent to saying that a n ( 1 0 n 1 4 ) a_n(10^{n - 1} - 4) is divisible by both 3 3 and 13 13 . We know that

1 0 n 1 4 1 n 1 1 0 ( m o d 3 ) , 10^{n - 1} - 4 \equiv 1^{n - 1} - 1 \equiv 0 \! \! \! \! \pmod{3},

so either 13 a n 13|a_n or 13 1 0 n 1 4 13|10^{n - 1} - 4 . If 13 a n 13|a_n , then a n 13 a_n \geq 13 , which cannot happen since a n a_n is a digit. Thus, we must have 13 1 0 n 1 4 13|10^{n - 1} - 4 , or 1 0 n 1 4 ( m o d 13 ) 10^{n - 1} \equiv 4 \pmod{13} . Checking powers of 10 10 mod 13 13 , we find that 1 0 5 + 6 k 4 ( m o d 13 ) 10^{5 + 6k} \equiv 4 \pmod{13} , for all nonnegative integers k k . We want the smallest value of n n , so we must have n 1 = 5 n - 1 = 5 , or n = 6 n = 6 .

Now that we know the value of n n , we can plug it into our original equation and divide both sides by 39 39 :

39 ( a 1 × 1 0 4 + + a 5 ) = a 6 ( 1 0 5 4 ) 39 ( a 1 × 1 0 4 + a 5 ) = 99996 a 6 a 1 × 1 0 4 + a 2 × 1 0 3 + a 3 + 1 0 2 + a 4 × 10 + a 5 = 2564 a 6 . \begin{aligned} 39(a_1 \times 10^4 + \cdots + a_5) &= a_6(10^5 - 4) \\ 39(a_1 \times 10^4 \cdots + a_5) &= 99996a_6 \\ a_1 \times 10^4 + a_2 \times 10^3 + a_ 3 + 10^2 + a_4\times 10 + a_5 &= 2564a_6. \end{aligned}

The left hand side is a five digit number, so we find the smallest value of a 6 a_6 such that 2564 a 6 2564a_6 is a five digit number, which will give the smallest such five digit number. This yields a 6 = 4 a_6 = 4 , and a 1 a 2 a 3 a 4 a 5 = 2564 × 4 = 10256. \overline{a_1a_2a_3a_4a_5} = 2564 \times 4 = 10256. Thus, N = a 1 a 2 a 3 a 4 a 5 a 6 = 102564 . N = \overline{a_1a_2a_3a_4a_5a_6} = \boxed{102564}.

We can check easily that 102564 × 4 = 410256 102564 \times 4 = 410256 , as desired.

Great solution. At the start, you could simplify it by saying N = 1 0 k a + b N=10^ka+b , which makes seeing the 39b more obvious.

Calvin Lin Staff - 5 years, 9 months ago

If number of digits of N N is n + 1 n+1 you can write 4 ( 10 A + B ) = 1 0 n B + A 39 A = ( 1 0 n 4 ) B 4(10A+B)=10^n B+A \\ 39A=(10^n -4)B where B B is the rightmost digit of N N and A A is a n n -digit number. It looks simpler this way. :)

Kazem Sepehrinia - 5 years, 9 months ago
Kunal Verma
Dec 1, 2015

include<iostream.h>

#include<conio.h>

#include<math.h>

unsigned long int newnum (unsigned long int a)

{

unsigned long int lim=0,num2=0,m,digit,count=0;

m=a;

while(a>0)

{

    lim+=1;

    a=a/10;

}

a=m;

while(count<lim)

{

     digit=a%10;

     if(count==0)

        num2+=digit*pow(10,lim-1);

     else

        num2+=digit*pow(10,count-1);

     a=a/10;

     count+=1;

}

a=m;

return num2;

}

void main()

{

clrscr();

unsigned long int a=1,x,y;

while(a<200000)

{

    y=a%10;

    x=newnum(a);

    if(x==4*a&&y!=0)

    {

        cout << a;

        break;

    }

    a=a+1;



}

getch();

}

I don't know why latex is acting up. This is the first time I'm posting a programming solution. And I'm not sure it's fair to do so here. Would really appreciate if a mod could do the needful here. There's a # in the beginning which somehow doesn't show up before people start pointing out.

Program runs in 10 secs to give the answer as 102564 102564

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...