1

In a children's math book I found the following example:

There are $2$ numbers: $242, 961$.

You can use these numbers as many times as you want, and you can use any arithmetical operator between them. E.g.: $242+242*961-961$

The result must be $562$.

One should determine the how these numbers can be used with any arithmetical operator to give the result. Which is the best way to solve it?

I tried it with Wolfram but didn't know how to supply these values to it. Is there a regular way to solve these types of tasks?

Do you have any hint?

usermath
  • 3,516
Nestor
  • 113

1 Answers1

2

This is not a children's answer but a sure way of getting there is by considering the gcd:

$$gcd(961, 242) = 1$$

Hence you can find $x$ and $y$ in $\mathbb Z$ such that: $$961x + 242y = 1$$ Multiply both sides by the required value, $562$ in your case and you obtain: $$961\cdot562x + 242\cdot 562y = 562$$

So by repetitive addition and subtraction of $961$ and of $241$, you can get there.

Use Euclid's algorithm and go backwards to get $x = 69$ and $y=-274$.

user88595
  • 4,549
  • Well, I never used the extended Euclidean algorithm, and I can't see the result yet. I'll try. – Nestor May 22 '14 at 13:28
  • @Nestor: I've just edited it. If you've never tried it, I suggest you first try with smaller numbers. – user88595 May 22 '14 at 13:30