Mirrored Product?

Let m m and n n be two different positive integers in reverse order (e.g. 1234 1234 and 4321 4321 ). Given that m n = 2460301056 , mn = 2460301056, find the value of m + n m + n .

Details and Assumptions :


The answer is 116970.

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.

7 solutions

Victor Loh
Jun 2, 2014

Firstly, 2460301056 = 2 8 × 3 2 × 233 × 4583 2460301056 = 2^{8} \times 3^{2} \times 233 \times 4583 .

Since both m m and n n have the same number of digits, they must have 5 5 digits each.

Also, one of the factors is 4583 4583 , and 4583 × 233 > 99999 4583 \times 233 > 99999 .

So one of the numbers (say m m ) must be of the form 4583 a 4583a where a a is an integer and n n must be of the form 233 b 233b where b b is an integer.

Since 99999 4583 < 22 \frac{99999}{4583} < 22 and 10000 4583 > 2 \frac{10000}{4583}>2 , a a can only take the value of 2 2 2^{2} , 2 3 2^{3} , 2 4 2^{4} , 2 × 3 2 \times 3 , 2 2 × 3 2^{2} \times 3 and 2 × 3 2 2 \times 3^{2} .

Testing, we find that a = 2 × 3 = 6 a=2 \times 3 = 6 yields m = 27498 m=27498 and subsequently n = 233 × ( 2 7 ) ( 3 ) = 89472 n=233 \times (2^{7})(3)=89472 . We have our desired answer 27498 + 89472 = 116970 27498+89472=\boxed{116970} .

the same method but don't you think this must be cheating? Because I don't think you must be knowing the prime factorization of the number or you must have found it.

@Yuxuan Seah What was the intended solution?

Kartik Sharma - 6 years, 10 months ago

BTW, I'm curious to know why did the asker of the question mentioned that

You may use a List of Primes

Was it intended to be a CS problem or Number Theory problem?

Arulx Z - 6 years, 1 month ago
Jianzhi Wang
Jun 3, 2014

Since the digit is a 10 digit number and the last digit is not 0, both the numbers must be 5-digits, so I tried for integer all the way to 99999 but it only takes 1 second. Here is my Python solution: ;)

def reverse_int(number): #function to reverse an integer a = 0 b = 0 c = 0 d = 0 e = 0 while number - 10000>=0: e = e + 1 number = number - 10000 while number - 1000>=0: a = a + 1 number = number - 1000 while number - 100>=0: b = b + 1 number = number - 100 while number - 10>=0: c = c + 1 number = number - 10 while number - 1>=0: d = d + 1 number = number - 1 reverse = 10000 d + 1000 c + 100 b + 10 a + e return reverse

for i in range(99999): #testing for integer up to 99999 k = i k = reverse_int(k) if i*k == 2460301056: print(str(i) + " and " + str(k)) else: pass

So you get: 27498 and 89472 and the sum is 116970.

Sorry but the indentation is a bit wrong...

Jianzhi Wang - 7 years ago

Impressive :D

Victor Loh - 7 years ago

While you're at it, shouldn't you make a reverse-function for integers of arbitrarily many digits? It would then be something like this. (I'm not sure why formatting doesn't work; if I do what's suggested in the formatting guide, it doesn't get any better, though. :() def revert(n): a=len(str(n))-1 b=0 while n: c=n%10 b+=c*10**a a-=1 n/=10 return b Dummy=False i=1 while Dummy==False: if i*revert(i)==2460301056: print i,i+revert(i) Dummy=True i+=1

HS N - 6 years, 9 months ago
Yuxuan Seah
Jun 1, 2014

... Here's a hint: The two numbers are 27498 and 89472. I'm so sorry but that's all I can say; the rest is up to the solver to figure out. (Good luck finding it!)

Can't spoil the fun, can I? ;D

Horisadi Afyama
May 26, 2015

SCRATCH2

Arulx Z
May 11, 2015
1
2
3
for(int i = 1000;;i++)
    if(Double.parseDouble(new StringBuilder(String.valueOf(i)).reverse().toString()) * i == 2460301056d)
        System.out.println(i + Integer.parseInt(new StringBuilder(String.valueOf(i)).reverse().toString()));

Bill Bell
Mar 28, 2015

This is a dreadful brute force hack. Surely it's only necessary to check for solutions somewhere closer to the square root of mn?

Mehul Chaturvedi
Mar 14, 2015

Python:

1
2
3
4
5
6
def re(n):   #i'm making reverse function as re(n)
    return int(str(n)[::-1])
for m in range(1,99999):
    k=re(m)
    if k*m==2460301056.0:
        print 'answer is',k+m

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...