Shadow system meets prime numbers

There is an easy way of converting the prime numbers into a (multi-)deck of cards, that can be memorized using any 2-card system (e.g., #shadow-system or #ben-system) of your liking. Below, I will use the shadow system to illustrate this method.

Excluding the single digit primes (2, 3, 5, and 7) all primes end in 1, 3, 7, or 9. A number ending in any of these digits either exists in a decade or it does not, so we have 2^4=16 combinations (just like we do suit pairs in 2-card systems.)

To convert the unit digits, we assign the first two (1 and 3) to the left card and the second two (7 and 9) to the right card. We say that we have a \color{blue}black\ suit if the first number exists (e.g., 41, 67, etc.) and a \color{red}red\ suit if it does not exist (e.g., 21, 57, etc.)

Initial values for black and red are \spadesuit and \heartsuit respectively. The second number works like the shift key on your keyboard, except that instead of an uppercase \spadesuit you are looking at a \clubsuit and instead of an uppercase \heartsuit you are looking at a \diamondsuit .


\begin{array}{cc|cc|cc} 11&13&17&19&\clubsuit\clubsuit\to K\ (decade\ 01)\\ &23&&29&{\color{red}{\diamondsuit}}\diamondsuit\to K\ (decade\ 02)\\ 31&&37&&\spadesuit\spadesuit\to S\ (decade\ 03)\\ 41&43&47&&\clubsuit\spadesuit\to N\ (decade\ 04)\\ &53&&59&{\color{red}{\diamondsuit}}\diamondsuit\to K\ (decade\ 05)\\ 61&&67&&\spadesuit\spadesuit\to S\ (decade\ 06)\\ 71&73&&79&\clubsuit\diamondsuit\to P\ (decade\ 07)\\ &83&&89&{\color{red}{\diamondsuit}}\diamondsuit\to K\ (decade\ 08)\\ &&97&&{\color{red}{\heartsuit}}\spadesuit\to T\ (decade\ 09)\\ &&&&\ \\ 101&103&107&109&\clubsuit\clubsuit\to K\ (decade\ 10)\\ \end{array}

The mappings of suit pairs to major code letters follows the standard order given in the original post on the #shadow-system. We use these for the suit pairs and the card rank is determined by the tenth digit and the unit digit of the decade for the left card and the right card, respectively.


A pair starting with a red suit tells us to move to the next location

  1. location
    \left[ \begin{array}{c|c} \color{gray}{1}\color{black}{0}&A\\ \clubsuit&\clubsuit \end{array} \right] \left[ \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&2\\ {\color{red}{\diamondsuit}}&\diamondsuit \end{array} \right> \to KST, KSN

  2. location
    \left> \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&3\\ \spadesuit&\spadesuit \end{array} \right] \left[ \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&4\\ \clubsuit&\spadesuit \end{array} \right] \left[ \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&5\\ {\color{red}{\diamondsuit}}&\diamondsuit \end{array} \right> \to SSM, NSR, KSL

  3. location
    \left> \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&6\\ \spadesuit&\spadesuit \end{array} \right] \left[ \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&7\\ \clubsuit&\diamondsuit \end{array} \right] \left[ \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&8\\ {\color{red}{\diamondsuit}}&\diamondsuit \end{array} \right> \to SSJ, PSK, KSK

  4. location
    \left> \begin{array}{c|c} \color{lightgray}{1}\color{black}{0}&9\\ {\color{red}{\heartsuit}}&\spadesuit \end{array} \right> \to TSP

  5. location
    \left> \begin{array}{c|c} A&\color{lightgray}{1}\color{black}{0}\\ \clubsuit&\clubsuit \end{array} \right| ...

Note that for the decades 01-09 we need to add a zero to get a value for the left card. It’s okay to use 10 for this purpose, because 10 is not otherwise in use as our last decade will be 99. With 99 decades (read card pairs), we are just shy of 4 decks of cards when compared to a regular 52 deck (i.e., 26 card pairs.)


Sequential access

If you want to recite the primes in order (after you’ve said “2, 3, 5, 7, …”), you simply start with the image in the first location. This is no different from putting your recall decks back in order. Say that your first image was “a ghost (KST) scaring your cousin (KSN).”

The decade is K:ST = 01 , so the potential primes are 011, 013, 017, and 019… and of course you can drop the leading zero that we’ve added during encoding. The leading K tells us that the suit pair is \clubsuit\clubsuit, so we have a \color{blue}black\ suit in both cases, so 11 and 17 exist. Also, we are looking at \clubsuit (shifted) not \spadesuit , so both 13 and 19 also exist.

The next decade is K:SN = 02 , so the potential primes are 021, 023, 027, and 029. The leading K tells us that the suit pair is \diamondsuit\diamondsuit , because this time we are in the last position, so we have a \color{red}red\ suit in both cases, so 21 and 27 do NOT exist. But, we are looking at \diamondsuit (shifted) not \heartsuit , so both 23 and 29 do exist.

Direct access

If you want to know if 329 is prime, you first drop the unit digit to get the decade 32. Then you quickly cycle through the 8 suit pairs: S:MN, T:MN, … immediately, you recall a blinking and beeping Simon (SMN) game. This tells us hat the suit pair is \spadesuit\spadesuit, no wait… you also recall that this was the last item in the sequence at that location, so make that \heartsuit\heartsuit instead.

So we have a \color{red}red\ suit in both cases, so 321 and 327 do NOT exist. Also, we are looking at \heartsuit (NOT shifted), so 323 and 329 do NOT exist either. You have thus determined that 329 is not a prime number.



Continuing the above example you can now look at what comes before and after that 80s Simon game to get the masking for the previous (31_) and the next (33_) decade. So even though 329 is not prime, you can say that 317 and 331 are the next prime numbers to the left and the right of 329.

This is similar to the pi matrix challenge where you are given a 5-digit sequence and have to name the 5 digits to the left and the right of it. In both scenarios you are combining direct access followed by sequential access.

The decades within a palace are unique, so you can’t mix them up because there is only one pair of cards 3x 2x, so if you already found the Simon (S:MN) game in the above example, you don’t need to go hunt for Lemons (L:MN) anymore.


On a meta level you also have the advantage that you can use your existing 3-digit major system or if you don’t have one, but plan to set one up… you have a nice playground. Obviously, training prime numbers this way will by proxy train your shadow system for cards as well.


A set of memory palaces

If you want to go past the primes up to 1,000 all you have to do is set up additional memory palaces for each cluster of 1,000 (i.e., 100 decades)… say 9 more to get to 10,000 because you want to start a prime matrix challenge similar to the aforementioned pi matrix challenge. The palace then gives you the millennium.

So if you want to want to know if 4,853 is prime, first you pick the palace for the 5th millennium (4,001 - 5,000) out of your set of palaces. Then you look for the decade 85 by prefixing the suit pairs: SFL, TFL, etc… and you recall Soufflé (SFL) and the fact that it was last in that location. So just like with Simon above, the mask is \heartsuit\heartsuit and 4,851, 4,853, 4,857, 4,859 are all not prime.


The primes up to 10,000 require thus: 10 palaces = 9 x 100 decades + 1 x 99 decades for a total of 999 card pairs, which is equivalent to ~38.5 decks of cards. That is just one deck more than the world record for one hour cards… but nobody said that you have to do it all in one hour. The pi matrix challenge requires 2,000 locations with 5 digits each, which is more than twice as many locations. Conclusion, this is definitely doable with reasonable effort.

Further reading

I’ve discussed this concept of reverse lookup across multiple memory palaces before in this post:


Sequential access

If you want to save on locations and the overall size of the memory palaces, you can skip prime gaps that span over an entire decade. The examples Simon and Soufflé are two such cases. There is no benefit to encoding them, because ( \begin{smallmatrix} ? & ? \\ \heartsuit & \heartsuit \end{smallmatrix}) card pairs just tell you that there is no primes in the decade and because they are \color{red}red require you to move to the next location.

Direct access

Check to see if the number is divisible by 3 before starting a reverse lookup. Had the number in the Soufflé example been 4,851 instead of 4,853 you could have immediate gotten the answer by quickly adding up all it’s digits. 4+8+5+1=18 which is a multiple of 3, so it can’t be prime. No need to use any memory palaces at all… in fact somebody without your system could have told you that 4,851 is not prime.


I don’t really get it. What is its purpose? Are you reusing a shadow system with the first prime numbers to see if a number is prime itself?!?!

The #shadow-system is used to memorize the virtual deck of cards that is created when converting prime numbers into card pairs the way I describe in the post.

The purpose is to have an easy way of memorizing prime numbers. So instead of memorizing the individual numbers, you simply use the 3-digit major system you already have for images and then the shadow system as a mechanism (for memorizing cards) that you already know.

So just dealing with old friends in terms of systems.You can memorize as many primes as you want with this approach; you just need to create a new palace for each range of 1,000 numbers.

What is a decade?

It looks super complicated, but if it works for you :man_shrugging:

Período de diez años referido a las decenas de siglo (p. ej. “la década de los sesenta”).

Are you talking about the translation of primes to card pairs? Let me know which parts you find complicated and I can explain in more detail.

If it’s the shadow system itself that you find complicated then read the original post on the shadow system, where it’s explained in much more detail. It wan’t my intention in this post to explain the entire system once more… we already have a post on it.

Thanks for the offering! I’ve studied engineering, math is not my strongest point.

For starters, what does have to do a time concept with primes? 10 years to primes? 10 primes to 10 years?

Granted, most of the time we say decade we refer to ten years, but it’s the 10 that is important not the years. Just like when someone says they have a millennium system, they mean a 3-digit system with 1,000 images not that it took them 1,000 years to learn it. A decade here simply refers to the range 11-20; 21-30; 31-40; etc.

In every decade you have 4 possible prime candidates 21, 23, 27, and 29 for example in decade 02. The first two decide the suit for the first card. The second two the suit for the second card. The decade itself is used for the ranks of the two card.

Everything that comes after has to do with the shadow system itself and how to memorize cards.

Ah okokok. So you use primes in each 10ths to encode suits.

I thought millenium PAO was because it was made 2000ish year. :sweat:

I’ll reread shadow soon. Still don’t see the link between the key and the assigned card. For some it must be very easy, but not for me.

Shadow system questions I’ll post in new post. Or in the shadow s post.