Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are lots of tricks where someone has to think of a number and you can 'guess' that number by just asking a couple of questions (see, for example, here). I'm looking for something kind of similar: a way to change an unknown number (by multiplying or adding something, etc.) so that it is divisible by some predefined number $n$. As I need this for some kind of math trick, the way to go should not be too obvious. So for example, if I told someone:

Think of a number. Now multiply it by 3.

it would be quite obvious that the resulting number is divisible by 3. Also, it should not be a too complicated algorithm. So, is there any much less obvious but still easy way of changing a number so that it is always divisible by some predefined number $n$?

I probably should add that I don't look for an algorithm that works for any $n \in \mathbb{N}$, it's enough if the algorithm just works for one $n$.

share|cite|improve this question
up vote 1 down vote accepted

There are tricks based on the fact that a number's value mod $9$ is invariant under permutations of its digits. So, for instance, if you say "think of a 4-digit number", and then "reverse its digits and find the difference between the original and reversed numbers," the results will always be divisible by $9$.

Also, since $1001=7\times11\times 13$, taking any 3-digit number and concatenating it with itself yields a number that is divisible by $7$, $11$, and $13$.

share|cite|improve this answer

For a trick, it is a good idea to keep things simple and do something like "Add 5, multiply the result by two, and add the original number."

You can then remove 10 yourself to get three times the original number.

Another way to get a number divisible by three: Let people reverse the order of digits in their number and calculate the difference between the original number and the result. Variations of these work for 9, 11, 7, 13.

share|cite|improve this answer

How about Fermat's Last Theorem? Then just subtract $1$.

share|cite|improve this answer
Well, let's see. Think of a three-digit number, but not ending in zero or five and digit sum not a multiple of three. Now take it to the eighth power and subtract one. I magically foresee that the result is divisible by fifteen. - Your audience won't like you. – Hagen von Eitzen Apr 17 '14 at 19:34
@HagenvonEitzen How is that the last theorem ($a^n+b^n=c^n$)? – user2345215 Apr 17 '14 at 19:50
@user2345215 D'oh, if you want to read a recipe that enforces divisibility, your mind simply ignores such crucial words. :) - Jsut like sentnces with lots of msipselld words are stlil more or less raedable ... – Hagen von Eitzen Apr 17 '14 at 20:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.