Prime numbers... useful applications?

Along the lines of the discussion from Double digit squares… useful applications?:

Can anybody think of any useful applications of knowing the primes up to 1,000 or 10,000 beside the obvious one of being able to tell if a number is prime or not without having to do any calculations.

Are there any algorithms in mental math that benefit from knowing the primes?

1 Like

You might want to take it one step further and add the prime multiplication to non-prime tables to your repertoire of facts. There are only 168 primes to 1000, quick recognition that these cannot be factored and practiced facility with calculating with them could add a some pleasant improvements. On the other hand it might just be a fun project with no positive outcomes other than an increased sense of numeracy. As an adult I find that trying to wire up numeracy takes time and repetition so a project like this would probably reap the additional benefits of practice and time while it kept me motivated.

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997

In daily use all I come up with is that quickly recognizing that a number cannot be decomposed keeps you from wasting time down an unfruitful path. Factorization is a practical element. From a numerical perspective they are fascinating. If you think of it one way all natural numbers are composed of primes. Mathematicians have spent life times trying to understand their nature and for the most part failing. Ulam Spirals mess with my head. https://www.youtube.com/watch?v=iFuR97YcSLM.

2 Likes

Well, the reason I’m asking is because I’m gonna setup a set of memory palaces to solidify my 3-digit system. I’ve done this before by placing my old PAO major system into 7 separate memory palaces linked to the year codes for calendar calculation.

Sidebar: I’ve seen in other posts that you are still trying to get a solid grip on your major system… maybe the year codes approach will work for you too. The nice thing is that you constantly use the lookup of your major images even though you are technically doing calculations, so it becomes more of a background task.

The setup for the primes would be like this… taking only up to 1,000 instead of 10,000 to make it easier to read:

0 [20, 32, 51, 53, 62, 84, 89]
1 [18, 21, 24, 42, 63, 66, 69, 81]
2 [11, 29, 68, 74, 77, 86, 95, 98]
3 [28, 52]
4 [9, 12, 30, 36, 39, 45, 48, 55, 58, 72, 78, 79, 87, 90, 93, 96]
5 [3, 6, 15, 25, 27, 33, 54, 57, 60, 75, 94, 97, 99]
6 [16, 67]
7 [4, 31, 46, 64, 88]
8 [14, 41, 47, 71, 80, 83, 92]
9 [40, 49, 70, 76, 91]
10 [2, 5, 8, 17, 23, 26, 35, 37, 38, 44, 50, 56, 59, 65, 73]
11 [7, 43]
12 [34]
13 [13]
14 [22, 61, 85]
15 [1, 10, 19, 82]

I’m using a bit-mask for the last digit, where 0000 corresponds to 9731. It’s the same logic used when doing chmod 777 (https://www.maketecheasier.com/file-permissions-what-does-chmod-777-means/). Basically, it works like this:

  1. get a number xyz (343) or later wxyz
  2. drop the last digit z (3) from xyz or later wxyz
  3. look up the decade xy (34 = MR = image) in the palace set
  4. convert the decade's palace from base10 (12) to base2 (1100)
  5. apply this mask to 9731 (97##); these are the primes: 349 and 347

So now you know that the decade (seems like a sensible name) only has primes ending in 9 and 7 (i.e., 349 and 347), so 343 is not a prime. Up to 16 I have no problem converting between decimal, binary, and hex, so I won’t lose any time there. It will cover all my images up to 999 except for 000 because the single digit primes (2, 3, 5, 7) don’t fit the pattern.

In the end, it’s 16 palaces with half as many loci as there are items, if I put two images per location. The bigger palaces will be subdivided into more manageable sizes about the size of the smaller palaces. In the end, the whole thing will look like this:

0 218 items
1 106 items
2 104 items
3 25 items
4 108 items
5 94 items
6 25 items
7 16 items
8 104 items
9 25 items
10 95 items
11 15 items
12 21 items
13 14 items
14 18 items
15 11 items

I won’t be able to show off by recalling all primes in order but lookup will be almost instantaneous: drop the last digit, find which palace that image is in, and see if the mask allows for the dropped digit.

Still looking for a set of palaces that works with 16… at the moment I’m considering the list of German states by area but not completely convinced it’s the best set of 16. It would be easy enough though to find a route with enough locations in each state’s capital.

ps: would still be nice though if I could do more with it than know whether a number is prime or not.

2 Likes

I don’t know how to do quick math in determine prime.
But if I am asked to check a number whether it’s a prime number or not up to first 1000 prime?
I would do it in a memory sense way:

n prime(n)
1 2
2 3
3 5
4 7
5 11
6 13

::

n prime(n)
994 7873
995 7877
996 7879
997 7883
998 7901
999 7907
1000 7919

We all know that no even numbers are pi. And there is actually like 1/8 numbers are prime within the value 8000. We will expect that when the 10^index is getting higher, there will be lesser prime numbers because of more constraints are set-up.

So, if using PAOX system, I would divide the prime numbers into label format:
** One-word size format** applicable up to 1000 prime numbers.
Pick a location:
[ p ] [ a ] [ o ] [ x ] , 8 digits
~
[ Addressing index ] [ prefix ] [ suffix ]
~
[ 00 01 ] [ 00 ] [ 02 ]
[ 00 02 ] [ 00 ] [ 03 ]
::
[ 09 99 ] [ 79 ] [ 07 ]
[ 10 00 ] [ 79 ] [ 19 ]

** Double-word size format**
Pick two consecutive locations:
[ 00 ] [ 01 ] [ 00 ] [ 47 ]
[ 00 ] [ 00 ] [ 10 ] [ 29 ]
//Remarks: 00 01 00 00 are the High and Low address,
00 10 are the High and Low prefix,
47 29 are the High and Low suffix.

The ten-thousandth prime is 104729.

1 Like

I’m not doing quick math either… just looking up the first 3-digits of a 4-digit number and see which memory palace it’s in. By using 16 different memory palaces I only need 500 loci for the primes up to 10,000 though.

I’ve been thinking this too. Knowing the X table of Primes gives you most of the rest of the table quite quickly. I’m planning on doing a version of this project for myself.

The 14X table is just two times the the 7X. 17X has to be memorized but then you get 34X , 51X… etc fairly easily.

2 Likes

To some extent the accumulation of hard wired facts creates new opportunities. I’m don’t think that numeracy outperforms well-drilled algorithms in performance. It seems like hammering on lattice multiplication provides better results in multiplication sooner BUT it doesn’t seem like it broadens your sense of numeracy nearly as much as thinking about numbers and their relationships. I suspect that it all depends on your objectives. Many just want to multiply larger numbers faster. The shortest path to that seems to be consistent practice of an algorithm. I have always “claimed” that I was trying to understand numbers better so it has coloured my approach and quite likely limited my success. A smarter man than I would probably attack the problem from both ends at the same time.

In general, there is no ‘quick math’ to determine primes. Some patterns can be eliminated quickly but, in general it’s down to brute force testing all factors. Modern Cryptography depends on the fact that it’s extremely hard to detect big primes.

This too is why it’s useful to memorize the primes. They are atomic - their pattern can’t be simplified.

1 Like