Sunday 14 February 2021

Primorial Number System

 I've written about the factorial number system in two previous posts:

It is a mixed radix number system and so is the primorial number system that uses the primorials (progressive products of primes):
  • 2
  • 2 x 3 = 6
  • 2 x 3 x 5 = 30
  • 2 x 3 x 5 x 7 = 210
  • 2 x 3 x 5 x 7 x 11 = 2310
  • 2 x 3 x 5 x 7 x 11 x 13 = 30030
  • 2 x 3 x 5 x 7 x 11 x 13 x 17 = 510510
  • 2 x 3 x 5 x 7 x 11 x 13 x 17 x 19 = 9699690 etc.
It's easy enough to set up an algorithm in SageMath that will convert decimal number to primorial digits. In decreasing order, the primorials below ten million are 9699690, 510510, 30030, 2310, 210, 30, 6 and 2. These numbers can serve as bases to represent any number up to 10,242,789 (which has representation as 111111111). Here is the algorithm (permalink) that will return the primorial base representation of any number up to 10,242,789. The example returns the representation for numbers from 2 to 50:

P=[9699690, 510510,30030,2310,210,30,6,2]
for number in [1..50]:
    original=number
    N=[]
    for p in P:
        N.append(number//p)
        number=number%p
    if is_odd(original):
        N.append(1)
    else:
        N.append(0)
    primorial=""
    for n in N:
        primorial+=str(n)
    print(original,"-->", int(primorial))

Primorial Formula

1 --> 1
2 --> 10
3 --> 11
4 --> 20
5 --> 21
6 --> 100
7 --> 101
8 --> 110
9 --> 111
10 --> 120
11 --> 121
12 --> 200
13 --> 201
14 --> 210
15 --> 211
16 --> 220
17 --> 221
18 --> 300
19 --> 301
20 --> 310
21 --> 311
22 --> 320
23 --> 321
24 --> 400
25 --> 401
26 --> 410
27 --> 411
28 --> 420
29 --> 421
30 --> 1000
31 --> 1001
32 --> 1010
33 --> 1011
34 --> 1020
35 --> 1021
36 --> 1100
37 --> 1101
38 --> 1110
39 --> 1111
40 --> 1120
41 --> 1121
42 --> 1200
43 --> 1201
44 --> 1210
45 --> 1211
46 --> 1220
47 --> 1221
48 --> 1300
49 --> 1301
50 --> 1310

Figure 1 shows a comparison of the factorial and primorial number systems:


Figure 1: source

The source for Figure 1 contains information on a wide range of unusual number systems which I may post about at some time in the future.

So what stimulated my interest in primorial number systems? Well, like most of my posts, it was prompted by my analysis of the number representing my diurnal age. Today I turned 26250 days old and this number has a striking factorisation:$$26250=7 \times 5^4 \times 3 \times  2$$The first entry for this number in the OEIS is A276086:


   A276086

Prime product form of primorial base expansion of \(n\): digits in primorial base  representation of \(n\) become the exponents of successive prime factors whose product a(\(n\)) is.  


It took me some time to understand what this meant. In the case of 26250, \(n\)=57 and its primorial base expansion is 1411. The resulting digits because the exponents of successive prime factors that multiply together to give 26250. In other words:$$7^1 \times 5^4 \times 3^1 \times 2^1 = 26250$$

No comments:

Post a Comment