Finding Number Pairs with Reversible Results

  • Thread starter Greg Bernhardt
  • Start date
In summary, the conversation discusses pairs of numbers with the same characteristics where the result of adding them is the reverse of the result of multiplying them. While most pairs have two-digit results, there is one pair that has a triple-digit result. It is acceptable to use a computer to solve this problem, as long as it is not a program specifically designed for this calculation. The solution to the problem is 497 and 2, with a result of 499 for addition and 994 for multiplication.
  • #1
19,559
10,351
If you add 9 and 9 you get 18, and if you multiply 9 by 9 you get 81 (the reverse of 18). There are 2 more pairs of numbers with the same characteristics and where the result is two-digit:
24 + 3 = 27 and 24 * 3 = 72
and
47 + 2 = 49 and 47 * 2 = 94

But there is only one pair of numbers with a triple-digit result and its reversion.

What are the 2 numbers?
 
Physics news on Phys.org
  • #2
Is it fair game to exhaust these via computer?
 
  • #3
seeing as there isn't a solution under a million... I am assuming you can use a computer

update: arg.. it's too big for QBASIC...
 
Last edited:
  • #4
Hurkyl, you've used a computer to get a brain teaser in the past... and I think brum has a point insofar as there's not really an analytic solution to the problem (heuristics maybe, but even those basically boil down to trying out a very large set of computations to see if you can stumble on the right answer).

Anyway, I have the solution from a Matlab program I wrote but after your post I decided to wait on Greg's input into this. In the future I think it should be more explicit what resources are and are not allowed in general (eg I would think google is a no-no for any of these) and in particular cases (eg the acceptability of the use of a computer program for a question like this one).
 
  • #5
Yah, I did on a previous one, but it didn't dawn on me until just now that it might not be in the spirit of the competition.
 
  • #6
hmmm... well I suppose use a computer, except if it's a program especially for that calculation.
 
  • #7
I too have come up with an answer. Instead of matlab, I used c++.

[edit]
So is that a yes for a program. Its my own code. See below:

#include <iostream>
#include <sstream>
#include <string>

using namespace std ;

bool reverse_equal( int x , int y )
{
string s1 , s1_flip = "" , s2 ;
ostringstream s1_stream , s2_stream ;
int xy_flip ;
s1_stream << x+y ;
s2_stream << x*y ;
s1 = s1_stream.str() ;
s2 = s2_stream.str() ;
for( int z = s1.length() - 1; z >= 0 ; z-- )
s1_flip += s1[z] ;
if( s1_flip == s2 ) return true ;
else return false ;
}

int main( void )
{
for( int x = 1; x < 1000 ; x++ )
{
for( int y = 1; y < 500 ; y++ )
{
if( reverse_equal( x , y ) )
{
cout << "X: " << x << endl ;
cout << "Y: " << y << endl ;
cout << "X+Y: " << x+y << endl ;
cout << "X*Y: " << x*y << endl << endl ;
}
}
} }


Answer :

X: 497
Y: 2
X+Y: 499
X*Y: 994
[edit]
 
Last edited:
  • #8
dduardo gets the point!
 

FAQ: Finding Number Pairs with Reversible Results

What is the mathematical equation for adding 9 and 9?

The mathematical equation for adding 9 and 9 is 9 + 9 = 18.

Why do we get 18 when we add 9 and 9?

This is because 18 is the sum of two equal numbers, 9 and 9. When we add them together, we are combining their values to get the total amount.

How can we prove that 9 + 9 = 18?

We can prove this mathematically by using the commutative property of addition, which states that the order of numbers being added does not affect the result. So, we can rearrange the equation to 9 + 9 = 9 x 2 = 18.

Can we use any other numbers to get 18 as a result?

Yes, there are many combinations of numbers that can be added to get 18 as a result. For example, 10 + 8 = 18, 12 + 6 = 18, and 15 + 3 = 18.

Is 18 the only possible outcome when adding 9 and 9?

Yes, when we add two equal numbers, the sum will always be the double of one of the numbers. So, when we add 9 and 9, the only possible outcome is 18.

Similar threads

Replies
18
Views
12K
Replies
4
Views
2K
Replies
1
Views
2K
Replies
12
Views
2K
Replies
12
Views
2K
Replies
13
Views
2K
Replies
19
Views
3K
Replies
13
Views
2K
Replies
21
Views
2K
Back
Top