To do this trick, you need to understand a little bit about the base-3 number system. Instead of in base-10 where we say how many 1’s, 1o’s, 100’s, etc. a number has, in base-3 we say how many 1’s, 3’s, and 9’s a number has. For this trick, you simply need to know how to express the numbers from 1 to 27 as made up of 1’s, 3’s, and 9’s.

Examples for converting numbers to base-3:

The number 3 in base-3 would be 10 (for 1 three and 0 one’s)

The number 5 in base-3 would be 12 (for 1 three and 2 one’s)

The number 9 in base-3 would be 100 (for 1 nine, 0 three’s, and 0 one’s)

The number 11 in base-3 would be 102 (for 1 nine, 0 three’s, and 3 one’s)

The number 18 in base-3 would be 200 (for 2 nine’s, 0 3’s, and 0 one’s