Metaprimes

One day a few years ago, while waiting for my dinner, I started doodling with prime numbers, and I came across a question I found interesting. Here’s how it came about.

When translating a number from binary to decimal notation by hand, you add together a series of products. For example:

1110 (binary)
 = (16 × 1) + (8 × 1) + (4 × 1) + (2 × 0)
 = 28 (decimal)

Each binary digit is multiplied by a distinct power of 2. Each string of binary digits therefore corresponds to a unique decimal number. Could there be an alternate way of “translating” these binary digits to express a unique product of primes?

That is, instead of each binary digit representing a power of two, it would instead represent a prime number. For example:

1110 (alt. binary)
 = 71 × 51 × 31 × 20
 = 7 × 5 × 3 × 1 = 105 (decimal)

In this case, each string of binary digits would again correspond to a unique decimal number. For example, if you wanted a “binary” string to express ten, you would need the prime factorization of ten:

10 (decimal)
 = 5 × 2
 = 51 × 30 × 21
 = 101 (alt. binary)

Of course, a problem arises when you try to do this for a number whose factors include a prime power greater than one. (For example, 18). One option would be to change the “binary” nature of the expression to an arbitrarily higher base, for example, ten, like so:

18 (decimal)
 = 32 × 21
 = 21 (alt. base 10)

But of course, any number with a factor that is the tenth or eleventh power of something could not be expressed this way, so we’re back to square one.

A more satisfying approach would be to create slots for squares of primes, primes to the 4th power, primes to the 8th power, etc., so that there would be no need for a value other than 0 or 1. Therefore, in addition to having digits representing 2, 3, 5, 7, 11, etc., there would also be digits representing 4, 9, 25, 49, etc., 16, 81, 625, etc., 256, etc. and so on.

When contemplating this question I was not aware of any formal name for these numbers, so I called them metaprimes, a term I will use in this piece. I have since learned these numbers are Fermi–Dirac primes, OEIS sequence A050376. They follow the form p2n, where p is prime and n is a non-negative integer. Here are the first few of these: 2, 3, 4, 5, 7, 9, 11, 13, 16, 17, 19, 23, 25, 29, 31, 37, 41, 43, 47, 49, 53… (True primes are shown without an underline.)

Every integer greater than 1 can be expressed as the product of these metaprimes, using each metaprime no more than once.

Using this scheme, we could represent the decimal number 120 like so:

120 = 5 × 4 × 3 × 2

Using metaprimes, we don’t need to use any factor more than once. If we assign each binary digit to a metaprime (right-most digit represents 2, second-right-most digits represents 3, etc.), we can continue like so:

5 × 4 × 3 × 2
 = 51 × 41 × 31 × 21
 = 1111 (metaprime binary)

Likewise, we could represent the decimal number 128 like so:

128 = 16 × 4 × 2
 = 161 × 130 × 110 × 90 × 70 × 50 × 41 × 30 × 21
 = 100000101 (metaprime binary)

Now here’s where things get interesting. These metaprime binary expressions look just like regular binary expressions, so what happens if we encode a regular decimal number into metaprime binary, then treat that result as a regular binary expression, then translate it back to decimal? For example, let’s try 18:

18 (decimal)
 = 91 × 70 × 50 × 40 × 30 × 21
 = 100001 (metaprime binary)

100001 (regular binary)
 = 32 + 0 + 0 + 0 + 0 + 1
 = 33 (decimal)

So 18 becomes 33. Let’s try it again:

33 (decimal)
 = 111 × 90 × 70 × 50 × 40 × 31 × 20
 = 1000010 (metaprime binary)

1000010 (regular binary)
 = 64 + 0 + 0 + 0 + 0 + 2 + 0
 = 66 (decimal)

So 33 becomes 66. One more time:

66 (decimal)
 = 111 × 90 × 70 × 50 × 40 × 31 × 21
 = 1000011 (metaprime binary)

1000011 (regular binary)
 = 64 + 0 + 0 + 0 + 0 + 2 + 1
 = 67 (decimal)

We can also do it in reverse. Let’s start with zero this time:

0 (decimal) = 0 (regular binary)
0 (metaprime binary) = 20 = 1 (decimal)

So zero becomes one. This makes sense, since 0 is considered the “additive identity” (regular binary is additive) and 1 is considered the “multiplicative identity” (metaprime binary is multiplicative.) Let’s try it again:

1 (decimal) = 1 (regular binary)
1 (metaprime binary) = 21 = 2 (decimal)

So one becomes two. Once more:

2 (decimal) = 10 (regular binary)
10 (metaprime binary) = 31 × 20 = 3 (decimal)

And two becomes three. If we keep doing this, we get the following series:

0, 1, 2, 3, 6, 12, 20, 28, 140, 260, 64, 11, 30, 420, 7488, 1,922,800, ...

After 1,922,800, the numbers grow logarithmically, approximating 253, 2125, 2413, and so on. There are a few numbers that either convert to themselves or switch back and forth, producing series like these:

4, 4, 4, 4... (binary 100)
5, 8, 5, 8... (binary 101 and 1000)
36, 36, 36, 36... (binary 100100)

However, most series spiral out to enormous values rapidly. Here are the next few:

7, 24, 35, 54, 756, 612,612, 2,291,867,200, ~264, ~2176, ~2684, ~23352, ~222464
9, 10, 15, 120, 3465, 908,960, ~252
13, 40, 45, 360, 7920, 1,673,196,525, ~2100
14, 60, 1260, 489,060, ~248
18, 21, 56, 315, 30,240, 65,334,825, ~272
19, 42, 135, 312, 5040, 5,569,200, ~256
22, 84, 308, 4032, 16,997,552, ~248

If you go in the reverse direction, the same thing happens, but quicker:

7, 16, 256, 262
9, 32, 257, 263
13, 128, 261, 8224, 263 + 257
14, 17, 512, 262 + 1
18, 33, 66, 67, 223, ~26604*
19, 1024, 262 + 4
22, 65, 136, 517, 262,208, ~260

*216, or 65,536, seems to be the 6604th metaprime.

Zero is the only non-negative integer without a “reverse” counterpart in this scheme.

If you were to graph these series, you would likely see a jerky parabola leaning to the right for most of these. Graphing the logs of the elements in the series smooths it out some:

Here are some open questions about these series.

  • Do any of these series which include at least one “small” element (e.g. under 1000 or so) “loop back down” to connect with another such series, or are they each distinct and disconnected, diverging towards infinity at either end?
  • So far, the only cyclical series with more than one element that I’ve found is the series containing 5. Are there any others? Any that have more than two repeating elements?
  • In the typical series which y follows x, log(log(y)) / log(log(x)) seems to be around 1.3 after the first few large (> 210) elements, and decreases as the series progresses. What is the mathematical significance to this number? As this number decreases, what does it converge to?
  • Are there any practical applications to this? (I would guess not, but you never know.)

I wrote a little C++ program to help me with the elements of the series that I couldn’t easily do by hand (such as ~264), but it is slow and clunky and uses a Large Integer class I developed specifically for this problem. Sometime I may re-write it, deriving one of the better Large Integer classes out there, but probably not anytime in the near future.

Here are some OEIS sequences related to metaprimes:
A079708: the sequence beginning with 0: 0, 1, 2, 3, 6, 12, 20, 28, 140, 260, 64, 11, 30, 420…
A133487: the sequence beginning with 256, lowest member is 7: 256, 16, 7, 24, 35, 54, 756…

Comments or questions (or answers?) E-mail me.

This page was created January 30, 2003 and last updated July 2, 2023.


Posted

in

by

Tags:

Comments

Leave a comment