Daniel's integer reversal

How many 3-digit positive integers N N are there such that if M M is the integer obtained by reversing the digits of N N , then

M = 27 38 N ? M = \frac{27}{38} N?

This problem is posed by Daniel W .


The answer is 2.

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.

4 solutions

Tim Vermeulen
Oct 20, 2013

27 M 9 M 9 S ( M ) = S ( N ) , 27 \mid M \implies 9 \mid M \implies 9 \mid S(M) = S(N), where S ( x ) S(x) denotes the digit sum of x x . Also, 9 S ( N ) 9 N 9 38 = 342 N , 9 \mid S(N) \implies 9 \mid N \implies 9 \cdot 38 = 342 \mid N, as 38 N 38 \mid N . We obtain that N { 342 , 684 } ( M , N ) { ( 243 , 342 ) , ( 486 , 684 ) } , N \in \{ 342, 684 \} \implies (M,N) \in \{ (243, 342), (486, 684) \}, of which both pairs satisfy the constraints.

I thought, Let N = a b c N=abc so M = c b a M=cba we get, N M = 99 ( a c ) N ( 27 / 38 ) N = 99 ( a c ) N = 9 38 ( a c ) N - M = 99(a - c) \implies N - (27/38)N = 99(a-c) \implies N = 9 \cdot 38 \cdot (a-c) As, N N is 3 digit, ( a c ) (a-c) can be 1 1 or 2 2 that gives N = 9 38 1 = 342 N = 9 \cdot 38 \cdot 1=342 and 9 38 2 = 684 9 \cdot 38 \cdot 2 = 684 No guessing needed ;)

Lutfar Milu - 7 years, 7 months ago

Log in to reply

Nice solution!

Tim Vermeulen - 7 years, 7 months ago

Great!

Muralidhar Kamidi - 7 years, 7 months ago

I don't really understand what the symbol stands for.

kksdk kkk - 7 years, 7 months ago

Log in to reply

What symbol?

Tim Vermeulen - 7 years, 7 months ago

Such a simple yet thoughtful solution. Great job..

Nishant Sharma - 7 years, 7 months ago
Angel Leon
Oct 21, 2013

danielIntegerReversal.c

#include <stdio.h>

int reverse(int n) {
    int result = 0;
    while (n > 0) {
        result = result * 10 + n%10;
        n = n/10;
    }
    return result;
}

int main(char* args, int nArgs) {
    int n,results = 0;
    float m,condition = 0;

    for (n=100; n < 1000; n++) {
        m = (float) reverse(n); 
        condition = n*(27/38.0);
        if (condition == m) {
            printf("m=%f  %d*(27/28)=%f !\n",
                   m,
                   n,
                   condition);
            results++;
        }
    }
    printf("found %d numbers.\n",results);
}


m=243.000000  342*(27/28)=243.000000 !
m=486.000000  684*(27/28)=486.000000 !
found 2 numbers.

In python:

numbs = [i for i in range(100,1000)]

for i in range(0,900):

x = str(numbs[i])

new_num = ""

new_num = new_num + x[2]

new_num = new_num + x[1]

new_num = new_num + x[0]

if 38*int(new_num) == 27*numbs[i]:

    count = count + 1

print(count)

which prints 2...

Gino Pagano - 7 years, 7 months ago

Log in to reply

ha, custom made reverse using str() and int(). not very elegant, but works.

Angel Leon - 7 years, 7 months ago
Ali Sayarnezhad
Oct 24, 2013

from the text of the question you will figure out that "m/n=27/38" ===> 100x+10y+z/100z+10y+x=27/38 ( Without any Problem! :-) ) so: 2700z+270y+27x=3800x+380y+38 ====> 3773x+110y=2662z ====><devide by 11> 343x+10y=242z and then you can guess the numbers(That I think is not very good idea! ) or continue...

Finally The nums whould be 342 & 684. >>>>2 is the answer.

Danny He
Oct 23, 2013

M M is an integer so N N is a multiple of 38 38 . M M is a multiple of 27 27 and hence N N is a multiple of 9 9 because the digit sum will be the same.

Clearly N N is a multiple of 2 , 9 , 2,9, and 19 19 so N is either 342 342 or 684 684 and it can be quickly verified that both of these values of N will generate values of M that follow the rules as given, so the answer is 2 2

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...