Memorable 12-digit primes
There’s an old joke about having to enter a 12-digit prime number to continue using a program. I wrote about this years ago , on how to use Python to come up with a 12-digit prime. But suppose you do this often, and so you’d like memorize a 12-digit prime so you could enter it without having to run a Python script.
Here’s an easy one: 999999999989. The following code verifies that this number is prime.
>>> from sympy import isprime
>>> isprime(999999999989)
True
Major system encoding
Maybe that’s too easy, so you’d like to first find a 12-digit prime, then memorize it using the Major memory system .
>>> import random
>>> while True:
... candidate = random.randint(10**11, 10**12 - 1)
... if isprime(candidate):
... print(candidate)
... break
298412857819
To encode 298412857819, you might come up with “knob o’ fire, tin foil, cave tuba.” These things look ridiculous when written down, but they actually work, especially when you come up with them yourself: it’s hard to reuse someone else’s mnemonics.
Working backward
To come up with a mnemonic that looks reasonable in writing, you might approach the problem the other way around: generate memorable phrases until one happens to encode as a 12-digit prime. I asked Grok to do this, and it came up with “A young man sits near the lake” which decodes to 273201024157.
>>> isprime(273201024157)
True
I read a book on memory tricks one time, and the chapter on the Major system began by stating some ordinary sentence and the corresponding number, then asked which you’d rather memorize. This was highly misleading. The author came up with the mnemonic first then calculated the number.
Mnemonics in practice
In practice the number comes first: you construct a mnemonic for a number; you don’t start with a mnemonic and search for a number it fits. And you are far more likely to come up with nonsensical streams like “knob o’ fire, tin foil, cave tuba” than prose like “A young man sits near the lake.” The system works, with pr
Comments
No comments yet. Be the first to share your thoughts.