chrwiencke / magic-1089

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Magic 1089

1089 is widely used in magic tricks because it can be "produced" from any two three-digit numbers. This allows it to be used as the basis for a Magician's Choice. For instance, one variation of the book test starts by having the spectator choose any two suitable numbers and then apply some basic maths to produce a single four-digit number. That number is always 1089. The spectator is then asked to turn to page 108 of a book and read the 9th word, which the magician has memorized. To the audience it looks like the number is random, but through manipulation, the result is always the same.

In base 10, the following steps always yield 1089:

Take any three-digit number where the first and last digits differ by more than 1. Reverse the digits, and subtract the smaller from the larger one. Add to this result the number produced by reversing its digits. For example, if the spectator chooses 237 (or 732):

732 − 237 = 495 495 + 594 = 1089 as expected. On the other hand, if the spectator chooses 102 (or 201):

201 − 102 = 99 99 + 99 ≠ 1089 contradicting the rule. However, if we amend the third rule by reading 99 as a three-digit number 099 and take its reverse, we obtain:

201 − 102 = 099 099 + 990 = 1089 as expected.

About


Languages

Language:Python 100.0%