Showing posts with label primorial. Show all posts
Showing posts with label primorial. Show all posts

Friday, 21 February 2025

Primorial Number Base Revisited

On the 14th February 2021, now over four years ago, I created a post on this blog about the Primorial Number System. Since then, I've thought very little about it but today's number (associated with my diurnal age) reminded me once again of this number system. The number is \( \textbf{27718} \) and it is a member of OEIS A333703:


A333703   Numbers \(k \)such that \(k\) divides the sum of digits in primorial base of all numbers from \(1\) to \(k\).


The numbers that satisfy up to 40000 are:

1, 2, 10, 22, 58, 62, 63, 64, 66, 67, 68, 118, 178, 418, 838, 1258, 1264, 1265, 1277, 1278, 1678, 2098, 4618, 9238, 10508, 10509, 10510, 10512, 10513, 10514, 13858, 14704, 14754, 18478, 23098, 23102, 23276, 27718


Table 1 shows the numbers from OEIS A333703 together with their primorial base equivalents and the progressive totals of the digits of the all the primorial numbers up and including each number. The primorial base representation I've employed here uses the base 10 digits (0 to 9) together with a space as a separator (although colons are more commonly used). However, for numbers in the range up to 40000 that I use the base 12 system using the additional digits A for 10 and B for 11 are sufficient so that concatenation of the "placeholders" does not produce any ambiguity. The primorial number then looks like a normal base 12 number which produces an ambiguity in itself.


Table 1: permalink

Table 2 shows the numbers together with their corresponding progressive totals and the results when these totals are divided by the corresponing number.


Table 2: permalink

The next number after 22718 is 60058 so I won't be around to see that. For more information see this source. I started this blog by referring to my diurnal age on the 21st February 2025 (27718) but my diurnal age on the very next day (\( \textbf{27719} \)) also has a property that connects it to the primorial number base.


A343048   a(\(n\)) is the least number whose sum of digits in primorial base equals \(n\).


The members of this sequence up to 40000 are (permalink):

0, 1, 3, 5, 11, 17, 23, 29, 59, 89, 119, 149, 179, 209, 419, 629, 839, 1049, 1259, 1469, 1679, 1889, 2099, 2309, 4619, 6929, 9239, 11549, 13859, 16169, 18479, 20789, 23099, 25409, 27719, 30029

Table 3 shows the increasing values of \(n\):


Table 3: permalink

Tuesday, 11 February 2025

Primorials and the Sigma Function

I noticed that the sum of divisors (64680) of the number (27708) that represents my diurnal age today has the following factorisation:$$64680 = 2^3 \times 3 \times 5 \times 7^2 \times 11$$These prime factors, ignoring multiplicity, represent the factorisation of a primorial, in this case the primorial 2310:$$2310 = 2 \times 3 \times 5 \times 7 \times 11$$This got me wondering what other numbers in the range up to 40000 have a sum of divisors whose prime factors, again without multiplicity, form the primorial 2310. It turns out that there are 267 such numbers. They are (permalink):

1538, 2180, 2309, 2456, 2636, 2834, 3488, 3688, 3845, 4469, 4472, 4614, 4618, 4796, 4988, 5276, 6152, 6158, 6540, 6927, 7085, 7368, 7412, 7690, 7908, 7916, 8424, 8459, 8502, 8567, 8759, 8780, 8903, 8938, 9047, 9236, 9239, 9396, 9848, 9956, 10028, 10148, 10464, 10766, 11064, 11336, 11414, 11535, 11545, 11549, 11666, 11876, 11954, 12280, 12447, 12644, 13073, 13180, 13196, 13369, 13407, 13416, 13544, 13624, 13854, 13859, 14048, 14104, 14148, 14170, 14388, 14776, 14964, 14972, 15196, 15260, 15308, 15380, 15395, 15398, 15587, 15828, 16163, 16211, 16340, 16578, 16918, 17134, 17147, 17192, 17440, 17518, 17687, 17806, 17876, 17999, 18017, 18094, 18113, 18203, 18209, 18440, 18452, 18456, 18472, 18474, 18478, 19116, 19316, 19838, 19988, 19994, 20488, 20492, 20789, 21088, 21116, 21146, 21242, 21255, 21276, 22236, 22301, 22345, 22360, 22518, 22852, 23070, 23090, 23098, 23099, 23108, 23220, 23748, 23756, 23980, 24089, 24416, 24608, 24632, 24894, 24940, 25064, 25377, 25399, 25409, 25628, 25701, 25724, 25727, 25816, 26144, 26146, 26277, 26340, 26380, 26396, 26568, 26709, 26738, 26814, 26915, 27016, 27019, 27141, 27199, 27323, 27352, 27359, 27383, 27708, 27717, 27718, 27956, 28340, 28404, 28535, 28552, 28836, 28996, 29165, 29222, 29544, 29852, 29868, 29885, 30014, 30017, 30084, 30186, 30302, 30444, 30508, 30537, 30760, 30780, 30788, 30790, 30916, 30956, 31174, 31283, 31304, 31529, 31676, 31928, 31937, 32298, 32326, 32357, 32422, 32591, 32981, 33256, 33368, 33497, 33572, 33836, 33869, 33939, 34008, 34242, 34268, 34294, 34635, 34647, 34649, 34916, 34998, 35036, 35093, 35180, 35374, 35612, 35628, 35699, 35752, 35862, 35948, 35998, 36034, 36077, 36143, 36188, 36226, 36406, 36418, 36419, 36437, 36557, 36840, 36932, 36956, 37060, 37152, 37932, 38368, 38495, 38498, 38597, 38804, 39219, 39253, 39540, 39580, 39588, 39904

What caught my attention in this sequence of numbers was a pair of numbers that will be coming up for me in a little over a week. The numbers are 27717 and 27718. This got me to wondering if there were other such number pairs in the range up to 40000 and it turns out that there are. The other two are (23098, 23099) and (36418, 36419). See Table 1 for the details. 


Table 1

27718 also has the interesting property that its cototient has the same prime factors as 2310 since the totient is 13858 and thus the cototient is$$27718 - 13858 = 13860 = 2^2 \times 3^2 \times 5 \times 7 \times 11$$In the range up to 40000, the only numbers with this property are 4618, 9236, 18472, 18478, 23098, 27718 and 36956 (permalink). 

Anyway getting back on track, these pairs got me thinking about runs of three consecutive numbers and perhaps higher runs. I extended the range up to one million and in that range there are seven triplets of numbers whose sum of divisors consists form the factors of the primorial 2310. See Table 2.


Table 2

Looking at Table 2 it can be seen that there are two groups of quadruplets. See Table 3.


Table 3

Let's just double check the last quadrupets 692994, 692995, 692996 and 692997. See Table 4.


Table 4

So in terms of my diurnal age what's of interest is that the number pair 27717 and 27718 is coming up in a little over a week and its members share the interesting property discussed in this post. Let's move on to the primorial 210 = 2 x 3 x 5 x 7. In the range up to 40000, there are 1945 numbers with sums of divisors with prime factors (considered without multiplicity) that multiply together to give the primorial 210. I won't list them all but here is a permalink.

Restricting ourselves to the range up to 40000, we do get two groups of quintuplets. They are 20154 to 20158 and 29395 to 29399. 

Quadruplets are more numerous of course and Table 5 shows these.


Table 5: permalink

Groups of triplets are shown in Table 6.


Table 6: permalink

The pairs are too numerous to list here but this is a permalink.

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 the numbers 27717 and 27718 (where we don't need  any primorials above those numbers):

P=[2310,210,30,6,2]
for number in [27717..27718]:
    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,"-->",primorial)

27717 --> 11 10 6 4 1 1 
27718 --> 11 10 6 4 2 0 

Notice the spaces between the base-10 numbers in the primorial base representation (although colons are more commonly used) where:

27717 = 11 x 2310 + 10 x 210 + 6 x 30 + 4 x 6+ 1 x 2 + 1
27718 = 11 x 2310 + 10 x 210 + 6 x 30 + 4 x 6 + 1 x 2 + 0

For more information see this source. For any number in the range up to 40000 that I focus on, the letter A can be used for 10 and the letter B for 11 can be used. Additional letters can be used for larger numbers (up to a point). The colons, spaces or other separators are then not needed and the resultant single digits can be concatenated without ambiguity. Thus:$$27717_{10} \rightarrow BA6411_{primorial}\\27718_{10} \rightarrow BA6420_{primorial}$$However, it needs to be remembered that the numbers on the right (directly above) are not base 12 numbers and that the digits are merely convenient placeholders. To emphasise this, consider the base 12 equivalents of 27717 and 27718:$$27717_{10} \rightarrow 14059_{12}\\27718_{10} \rightarrow 1405A_{12}$$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$$

Sunday, 28 October 2018

Prime Producing Linear Polynomials

An example of a famous prime producing polynomial is \(n^2-n+41 \) which produces primes for values of \(n\) from 1 to 40. These primes are shown below:
41, 43, 47, 53, 61, 71, 83, 97, 113, 131, 151, 173, 197, 223, 251, 281, 313, 347, 383, 421, 461, 503, 547, 593, 641, 691, 743, 797, 853, 911, 971, 1033, 1097, 1163, 1231, 1301, 1373, 1447, 1523, 1601
Figure 1 is an excerpt relating to this polynomial from an interesting article on prime-generating polynomials:


Figure 1

Figure 2 shows a table of record prime producing polynomials taken from MathWorld:


Figure 2

However, prime producing linear polynomials get less attention than the above quadratic, cubic and higher order polynomials. Today I turned 25410 days old and discovered that the linear polynomial \(25410 \, n+1 \) has some interesting prime producing qualities. Specifically, it produces primes for values of \(n\) from 1 to 6: 25411, 50821, 76231, 101641, 127051, 152461. As it turns out, 25410 is the first coefficient of \(\ a*n+1\) to produce six primes in a row. The next such number is 26040.

OEIS A237190 displays a list of coefficients of of \(\ a*n+1\) that produce five primes in a row:
10830, 25410, 26040, 88740, 165900, 196560, 211050, 224400, 230280, 247710, 268500, 268920, 375480, 377490, 420330, 451410, 494340, 512820, 592620, 604170, 735750, 751290, 765780, 799170, 808080, 952680, 975660, 1053690, 1064190, 1132860, 1156170, 1532370, 1559580
As can be seen, 10830 is the first coefficient with this property. The OEIS entry also provides a list of the first 1000 such coefficients and this is a good starting point when trying to find coefficients that produce six, seven, eight or more primes in a row. With a little manipulation in a spreadsheet, the OEIS data can be pasted directly into a list set up on SageMathCell.

Of the first 1000 coefficients that produce five primes, only the following go on to produce seven primes in a row (in the range 1 to 247289070): 
512820, 8224860, 22240680, 24462900, 26486460, 62871480, 93784530, 99597960, 139819680, 196474950
Of these only the following go on to produce eight primes in a row: 

512820, 22240680, 26486460, 99597960

All four of the above fail to produce a ninth prime. Thus 512820 is the smallest coefficient that will produce eight primes in a row. In terms of primes produced over a given range and not sequentially, it would seem that 15213870 is the most prolific. It produces 40 primes between \(n+1 \) and \(100 \,n+1\) whereas 512820 produces only 33 in the same range.

What do these numbers have in common. To begin with they are all divisible by 30 and are highly factorable. The following table shows the factorisation and number of divisors for the numbers in OEIS A237190:


Figure 3

It would seem that by adding 1 to multiples of such highly factorisable numbers increases the odds of generating a prime number. Interestingly, for the 1000 coefficients mentioned earlier, the polynomial \(25410 \, n+41\) produces a record 41 primes in the range from 1 to 100, more than for any other coefficient. This naturally leads to an investigation of polynomials of the form \(25410 \, n+p\) where \(p\) is prime. Here is a table of what showed up for primes from 2 to 97:


Figure 4

Clearly \(25410 \, n+97\) wins that race and in fact holds the record for all primes below 1000. For primes up to 100000, \(25410 \, n+5471\) takes the lead with 48 primes and only surrenders it to \(25410 \, n+982231\) with 49 primes when considering primes up to one million. Below are the 49 primes generated by \(25410 \, n+982231\) as n ranges from 1 to 100:


Figure  5


Figure 6

I must say that SageMath makes it incredibly easy to investigate matters such as this. Interestingly, of all the possible coefficients from 1 to 999,999, it is \(25410 \, n+982231\) that produces the highest score of 49 primes out of 100. I was beginning to start to think that this might be something of a record until I went back to \(\ a*n+41\) and thought I'd test all the numbers up to 999,999. The table in FIGURE 6 shows the surprising result. 

The factorisations again show the same pattern as with the earlier numbers:
  • 6 = 2 * 3
  • 12 = 2 * 2 * 3
  • 30 = 2 * 3 * 5
  • 60 = 2 * 2 * 3 *5
  • 210 = 2 * 3 * 5 * 7
Testing with other primes between 2 and 9999 and coefficients from 1 to 9999 (trying upper bounds of 999999 seemed to overwhelm the SAGE server) showed the best result was with the unpretentious \( 6 \,n+5 \) that produces a total of 56 primes between \(n=1\) and \(n=100\).

However, this 56% hit rate for primes when n is between 1 and 100 is not sustained. For example, setting lower and upper bounds of 4000 and 5000 for \( 6 \,n+5 \) generates 289 primes between 24005 and 30005. This is an average of 289/1000 or about 28.9%.

on August 30th 2021

See related post titled Linear Prime Chains uploaded on December 21st 2022.

Monday, 30 July 2018

Practical Numbers

Today I turned 25320 days old but I accidentally entered 25230 into the OEIS and discovered that it was a practical number, specifically one that formed the central member of a triple of practical numbers. It is a number \(n\) such that \(n-2\), \(n\), \(n+2\) are all practical numbers (OEIS A287682). So in this case, the other members of the triple are 25228 and 25232. This is not a common occurrence as can be seen by the initial members of the sequence:
4, 6, 18, 30, 198, 306, 462, 702, 1482, 2550, 3330, 4422, 5778, 6102, 6498, 9042, 11178, 11778, 14418, 15498, 17298, 17442, 19458, 20862, 21582, 22878, 23322, 23550, 25230, ...
This led me to investigate what characterised a practical number and during that process I realised that I'd wrongly entered my number of the day. However, as it turns out 24320 is also a practical number but not a member of a triplet (the next entry in OEIS A287682 is 26622). I was encouraged to continue my investigations. According to Wikipedia:
In number theory, a practical number or panarithmic number is a positive integer \(n\) such that all smaller positive integers can be represented as sums of distinct divisors of \(n\). For example, 12 is a practical number because all the numbers from 1 to 11 can be expressed as sums of its divisors 1, 2, 3, 4, and 6: as well as these divisors themselves, we have 5 = 3 + 2, 7 = 6 + 1, 8 = 6 + 2, 9 = 6 + 3, 10 = 6 + 3 + 1, and 11 = 6 + 3 + 2.
The practical numbers themselves are rather frequent. OEIS A005153 lists these initial practical numbers:
1, 2, 4, 6, 8, 12, 16, 18, 20, 24, 28, 30, 32, 36, 40, 42, 48, 54, 56, 60, 64, 66, 72, 78, 80, 84, 88, 90, 96, 100, 104, 108, 112, 120, 126, 128, 132, 140, 144, 150, 156, 160, 162, 168, 176, 180, 192, 196, 198, 200, 204, 208, 210, 216, 220, 224, 228, 234, 240, 252, ...
As can be seen, all except 1 are multiples of 2 and this is one condition for a number being practical. The fully rigorous statement of what determines a practical number would be:

A positive integer greater than one with prime factorisation
\(n=p_1^{\alpha_1} \dots p_k^{\alpha_k}\) (with the primes in sorted order) is practical if and only if each of its prime factors \(p_i \) is small enough for \(p_i-1 \) to have a representation as a sum of smaller divisors. For this to be true, the first prime \(p_1 \) must equal 2 and, for every \(i \) from 2 to \( k \), each successive prime \(p_i \) must obey the inequality:$$ p_i\leq1+\sigma(p_1^{\alpha_1}p_2^{\alpha_2}\dots p_{i-1}^{\alpha_{i-1}})=1+\prod_{j=1}^{i-1}\frac{p_j^{\alpha_j+1}-1}{p_j-1}$$where \( \sigma(x) \) denotes the sum of the divisors of \(x\). For example, 2 × 3^2 × 29 × 823 = 429606 is practical, because the inequality above holds for each of its prime factors: 3 ≤ \(\ \sigma \)(2) + 1 = 4, 29 ≤ \( \sigma \)(2 × 3^2) + 1 = 40, and 823 ≤ \(\sigma \)(2 × 3^2 × 29) + 1 = 1171.

on August 1st 2021

With some difficulty I developed some SAGE code to calculate the practical numbers contained in a given range. The example at the end of this post is for the range from 26400 to 26500. It includes multiples of 2 because all powers of 2 are practical numbers along with all perfect numbers and primorials. Such numbers are not merely of interest to recreational mathematicians. They are of interest to professional mathematicians because many of their properties are similar to the properties of the prime numbers.

Sunday, 1 April 2018

Highly Composite Numbers

Today I turned 25200 days old and I was surprised to find that this number has a staggering 347 entries in the Online Encyclopaedia of Integer Sequences (OEIS). Most numbers of this size are lucky to have more than a dozen entries. So what's so special about 25200? Well, it turns out to be a highly composite number, a term first coined by Ramanujan in 1915 and defined as a number that sets a record for the highest number of factors (in this case 90). Here is a table from Wikipedia showing details for the first 38 highly composite numbers (sequence A002182 in the OEIS).
OrderHCN
n
prime
factorization
prime
exponents
prime
factors
d(n)primorial
factorization
1101
22112
34223
461,124
5122,136
6243,148
7362,249
8484,1510
9602,1,1412
101203,1,1516
111802,2,1518
122404,1,1620
133603,2,1624
147204,2,1730
158403,1,1,1632
1612602,2,1,1636
1716804,1,1,1740
1825203,2,1,1748
1950404,2,1,1860
2075603,3,1,1864
21100805,2,1,1972
22151204,3,1,1980
23201606,2,1,11084
24252004,2,2,1990
25277203,2,1,1,1896
26453604,4,1,110100
27504005,2,2,110108
28554404,2,1,1,19120
29831603,3,1,1,19128
301108805,2,1,1,110144
311663204,3,1,1,110160
322217606,2,1,1,111168
332772004,2,2,1,110180
343326405,3,1,1,111192
354989604,4,1,1,111200
365544005,2,2,1,111216
376652806,3,1,1,112224
387207204,2,1,1,1,110240
All highly composite numbers are products of primorials as can be see from rightmost column of the table. In the case of 25200, the primorial factorisation is \( 2^2 \times 30 \times 210 \). There is a formula for calculating the number of factors for a number n:$$ \text{If }n=\prod_{i=1}^k p_i \, c^i \text{ then } d(n)=\prod_{i=1}^k (c^i+1)$$For example: $$ 25200=2^4\cdot 3^2\cdot 5^2\cdot 7 $$ $$ d(25200)=(4+1) \cdot (2+1) \cdot (2+1) \cdot (1+1) = 5 \cdot 3 \cdot 3 \cdot 2 = 90 $$The sequence of indices is non-increasing when the prime factor bases are placed in ascending order (4, 2, 2, 1 in the case of 25200). The final index is always 1 except in the cases of 4 and 36 where it is 2, thus making 1, 2 and 4 the only square, highly composite numbers.