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?
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$.