Ask A to take any number of counters that he pleases: suppose that he takes n counters.
Ask someone else, say B, to take p times as many, where p is any
number you like to choose.
Request A to give q of his counters to B, where q is any
number you like to select.
Next, ask B to transfer to A a number of counters equal to p times
as many counters as A has in his possession. Then there will remain in B's
hands q(p + 1) counters; this number is known to you; and the trick can be finished
either by mentioning it or in any other way you like.
The reason is as follows. The result of operation (ii) is that B has
pn + q counters, and A has n - q counters. The result of (iii) is
that B transfers p(n - q) counters to A; hence he has left in his
possession (pn + q) - p(n - q) counters, that is, he has q(p + 1) .
For example, if originally A took any number of counters, then (if you chose p
equal to 2), first you would ask B to take twice as many counters as A had done;
next (if you chose q equal to 3) you would ask A to give 3 counters to B; and then you
would ask B to give to A a number of counters equal to twice the number then in
A's possession; after this was done you would know that B had 3(2 + 1), that is,
9 left.
This trick (as also some of the following problems) may be performed equally well with one
person, in which case A may stand for his right hand and B for his left hand.