Sunday 29 May 2022

A Millennial Drought of Emirps

It only occurred to me today that my year of birth, 1949, is an emirp or a prime number whose reversal, 9491, is also a prime (but not the same prime). This definition excludes 2, 5 and 7 as well as palindromic primes like 11 and 131. This got me thinking about the distribution of emirps over the past two thousand years or so. There's been a steady stream of them beginning with 13 AD as shown below:

[13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389, 701, 709, 733, 739, 743, 751, 761, 769, 907, 937, 941, 953, 967, 971, 983, 991, 1009, 1021, 1031, 1033, 1061, 1069, 1091, 1097, 1103, 1109, 1151, 1153, 1181, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1279, 1283, 1301, 1321, 1381, 1399, 1409, 1429, 1439, 1453, 1471, 1487, 1499, 1511, 1523, 1559, 1583, 1597, 1601, 1619, 1657, 1669, 1723, 1733, 1741, 1753, 1789, 1811, 1831, 1847, 1867, 1879, 1901, 1913, 1933, 1949, 1979]

However, because all years in the third millenium begin with the digit 2, this one thousand year period contains no emirps and so, after 1979, there are no more until 3011 AD. There are 96 emirps between 13 AD and 1979 AD inclusive and, as I said earlier, my birth year is one of them. I was reading the Wikipedia entry for emirps and discovered the interesting concept of a twin emirp. This is a prime that is the smaller of a twin prime pair such that its emirp is also part of a twin prime pair. The smallest such twin emirp is 71 because it forms a twin prime pair 73 and because its emirp, 17, forms a twin prime pair with 19. In the range between 1 and 1999, the only twin emirps are 71, 1031, 1151 and 1229.

The Online Encyclopaedia of Integer Sequences (OEIS) lists a variety of categories of emirps. One such category is that of reflectable emirps that belong to OEIS A007628. The initial terms are 13, 31, 113, 311, 1031, 1033, 1103, 1181, 1301, 1381, 1811, 1831, 3011, 3083, 3301, 3803, 10333, 11003, 11083, 11833, 18013, 18133, 18803, 30011, 30881, 31033, 31081, 31183, 33013, 33181, 33301, 33811, 38011, 38113. Another category is that of norep emirps: primes with distinct digits which remain prime when reversed. These occuply OEIS A046732 and the initial members are 13, 17, 31, 37, 71, 73, 79, 97, 107, 149, 157, 167, 179, 347, 359, 389, 701, 709, 739, 743, 751, 761, 769, 907, 937, 941, 953, 967, 971, 983, 1069, 1097, 1237, 1249, 1259, 1279, 1283, 1409, 1429, 1439, 1453, 1487, 1523, 1583, 1597, 1657, 1723, 1753. In fact, just typing the word “emirps” into the OEIS search bar brings up 211 different results:

Saturday 21 May 2022

Iterations of a Ceiling Function

It was back when I turned 26671 days old on April 11th 2022 that I first came across an unusual function that when applied repeatedly, so that the output becomes the new input, leads to zero or a loop. Here is the function \( n \) is any integer \( \ge 1\):$$\lceil \sqrt{n} \, \rceil \times (\lceil \sqrt{n}\, \rceil^2 – n) $$It can be seen that, with when \( n \) is a square number, the value of the expression is zero. When applied to most numbers, the iteration leads to zero but, far less frequently, the sequence of numbers generated by the iteration leads to a loop. 26671 is one such number. It has the following trajectory:

26671, 36900, 67357, 63180, 81648, 42328, 22248, 37800, 43875, 47250, 59732, 71785, 10452, 16171, 27264, 48472, 81549, 70642, 30324, 52675, 51750, 53352, 2079, 1702, 2604, 5200, 9417, 18326, 23120, 44217, 64144, 94488, 115808, 161293, 125022, 104076, 81719, 22022, 26671

Thus we end up where we began, but this is not always the case as we shall see. The reason that I was reminded of this function is that today I turned 26710 days old and this number also has the property that it does not end in zero under repeated iterations but instead enters a loop. In the case of 26710, the loop is:

26710, 30504, 21175, 20586, 21600, 1323, 1702, 2604, 5200, 9417, 18326, 23120, 44217, 64144, 94488, 115808, 161293, 125022, 104076, 81719, 22022, 26671, 36900, 67357, 63180, 81648, 42328, 22248, 37800, 43875, 47250, 59732, 71785, 10452, 16171, 27264, 48472, 81549, 70642, 30324, 52675, 51750, 53352, 2079, 1702

Here it can be seen that the number does not return to its starting point but instead enters a loop beginning and ending with 1702. Interestingly, 26709 also enters a loop as well. The loop is:

26709, 30668, 54208, 18873, 23598, 18172, 7155, 5950, 10452, 16171, 27264, 48472, 81549, 70642, 30324, 52675, 51750, 53352, 2079, 1702, 2604, 5200, 9417, 18326, 23120, 44217, 64144, 94488, 115808, 161293, 125022, 104076, 81719, 22022, 26671, 36900, 67357, 63180, 81648, 42328, 22248, 37800, 43875, 47250, 59732, 71785, 10452

Such pairs are not all that common. The pairs up to this point are as follows:

(2222, 2223), (8399, 8400), (11457, 11458), (12950, 12951), (19005, 19006), (19847, 19848),
(22444, 22445), (23597, 23598), (25089, 25090), (25175, 25176), (25742, 25743), (26709,
26710)

Overall, the numbers that do not become zero constitute about 1.94% of the numbers in the range between 1 and 26710. These numbers constitute OEIS A219960 and the members up to 26710 are:

366, 680, 691, 1026, 1136, 1298, 1323, 1417, 1464, 1583, 1604, 1702, 2079, 2125, 2222, 2223, 2374, 2507, 2604, 2627, 2821, 2844, 2897, 3152, 3157, 3159, 3183, 3210, 3231, 3459, 3697, 3715, 3762, 3802, 3866, 3888, 3936, 3948, 4004, 4111, 4133, 4145, 4231, 4299, 4388, 4414, 4614, 4653, 4683, 4685, 4780, 4794, 4815, 5004, 5025, 5084, 5103, 5130, 5193, 5200, 5244, 5342, 5382, 5453, 5509, 5513, 5515, 5524, 5529, 5558, 5707, 5793, 5832, 5877, 5888, 5902, 5950, 5980, 5989, 6015, 6103, 6129, 6205, 6295, 6310, 6335, 6447, 6469, 6489, 6498, 6513, 6522, 6662, 6676, 6767, 6788, 6956, 7009, 7025, 7063, 7095, 7152, 7155, 7200, 7217, 7258, 7261, 7397, 7408, 7410, 7420, 7422, 7452, 7460, 7463, 7469, 7575, 7625, 7751, 7937, 7942, 7947, 7971, 8020, 8043, 8112, 8150, 8163, 8237, 8250, 8335, 8383, 8399, 8400, 8407, 8503, 8621, 8700, 8762, 8785, 8794, 8848, 8947, 8971, 9141, 9175, 9222, 9234, 9332, 9352, 9417, 9452, 9483, 9499, 9663, 9754, 9763, 9780, 9841, 9913, 9916, 9928, 9948, 10031, 10118, 10126, 10134, 10179, 10211, 10221, 10232, 10245, 10269, 10290, 10357, 10431, 10452, 10472, 10546, 10673, 10738, 10766, 10835, 10844, 10851, 10866, 10902, 10927, 10945, 11050, 11077, 11083, 11086, 11149, 11166, 11238, 11246, 11404, 11419, 11457, 11458, 11460, 11464, 11551, 11595, 11610, 11628, 11729, 11794, 11858, 11868, 11921, 12025, 12204, 12411, 12465, 12469, 12574, 12606, 12661, 12716, 12775, 12784, 12789, 12821, 12894, 12915, 12931, 12939, 12950, 12951, 12963, 12987, 12997, 13019, 13173, 13327, 13381, 13465, 13475, 13512, 13578, 13602, 13643, 13662, 13670, 13722, 13770, 13833, 13913, 13966, 13980, 14007, 14073, 14111, 14189, 14220, 14330, 14340, 14459, 14466, 14543, 14662, 14670, 14673, 14731, 14801, 14872, 14881, 14896, 14964, 15024, 15097, 15130, 15195, 15217, 15335, 15355, 15379, 15406, 15559, 15564, 15608, 15668, 15731, 15891, 15900, 16171, 16191, 16218, 16338, 16388, 16417, 16438, 16505, 16525, 16549, 16551, 16568, 16586, 16681, 16695, 16707, 16715, 16815, 16843, 16854, 16860, 16975, 17070, 17164, 17170, 17461, 17474, 17539, 17544, 17577, 17648, 17718, 17728, 17763, 17878, 17882, 17972, 18008, 18026, 18065, 18123, 18139, 18172, 18187, 18270, 18326, 18334, 18367, 18402, 18419, 18423, 18491, 18534, 18546, 18666, 18716, 18854, 18873, 18882, 18945, 18958, 18965, 18990, 19005, 19006, 19127, 19253, 19285, 19330, 19356, 19540, 19547, 19674, 19677, 19686, 19690, 19716, 19735, 19847, 19848, 19853, 19894, 19950, 19972, 20156, 20187, 20195, 20206, 20209, 20295, 20345, 20421, 20524, 20554, 20583, 20586, 20686, 20709, 20749, 20803, 20892, 20899, 20965, 21121, 21175, 21223, 21248, 21324, 21332, 21426, 21451, 21522, 21539, 21600, 21618, 21622, 21627, 21721, 21837, 21857, 21929, 22009, 22020, 22022, 22032, 22035, 22114, 22153, 22164, 22248, 22254, 22295, 22356, 22367, 22394, 22442, 22444, 22445, 22452, 22577, 22813, 22903, 22945, 22995, 23006, 23118, 23120, 23138, 23205, 23221, 23226, 23265, 23287, 23303, 23319, 23333, 23470, 23573, 23597, 23598, 23639, 23648, 23690, 23789, 23836, 24050, 24116, 24168, 24269, 24284, 24352, 24366, 24392, 24441, 24546, 24704, 24711, 24734, 24793, 24817, 24874, 24895, 24908, 24946, 25038, 25072, 25076, 25089, 25090, 25129, 25157, 25175, 25176, 25179, 25181, 25194, 25223, 25236, 25320, 25336, 25465, 25555, 25640, 25675, 25698, 25708, 25727, 25742, 25743, 25834, 25862, 25930, 25945, 26106, 26108, 26159, 26187, 26198, 26208, 26220, 26306, 26456, 26479, 26506, 26509, 26519, 26526, 26650, 26665, 26671, 26709, 26710

There are a number of conjectures associated with this ceiling function. These are listed in the OEIS comments and are:

Conjecture 1: All numbers under the iteration reach 0 or, like the elements of this sequence, reach a finite loop, and none expand indefinitely to infinity.

Conjecture 2: There are an infinite number of such finite loops, though there is often significant distance between them.

Conjecture 3: There are an infinite number of pairs of consecutive integers.

Thursday 19 May 2022

Untouchable Numbers

I’ve dealt with untouchable numbers before but only in passing. I’ve never devoted an entire post to the topic. In my Mathematical Meandering blog on Blogger, I mentioned this category of numbers in two posts: one titled The Connectivity of Numbers and the other Mathematical Properties of 2022. My diurnal age today happens to be 26708 and this number turns out to be untouchable, meaning that there are no numbers whose sum of aliquot parts is equal to this number.

26798 is the 3470th untouchable number, meaning that the frequency of such numbers over this range is about 13%. As the range is extended, it has been shown that this density remains at least greater than 6% and Paul Erdos has shown that there are infinitely many untouchable numbers. These numbers are listed in OEIS A005114 and the sequence begins:

2, 5, 52, 88, 96, 120, 124, 146, 162, 188, 206, 210, 216, 238, 246, 248, 262, 268, 276, 288, 290, 292, 304, 306, 322, 324, 326, 336, 342, 372, 406, 408, 426, 430, 448, 472, 474, 498, 516, 518, 520, 530, 540, 552, 556, 562, 576, 584, 612, 624, 626, 628, 658, …

It should be noted that a number cannot be untouchable if it is one more than a prime number \( p \) because then it would be the sum of the aliquot parts of \( p^2 \). Similarly, if a number is three more a prime number \( p \), it cannot be untouchable because then it would be the aliquot sum of \( 2p \). More formally, we can say that untouchable numbers are those numbers that are not in the range of the aliquot sum function \( s(n) \) where \( n \) is any positive integer and \( d \) represents its divisors:$$s(n)=\sum_{d|n, d \neq n} \! \! \! d $$The conjecture is that 5 is the only odd untouchable number but this has not been proven. If true, then all untouchable numbers are composite except 2. Writing a program to generate untouchable numbers is not as simple as it might seem because some quite large numbers can have a relatively small aliquot sum. Below is an SageMath algorithm that will generate the untouchable numbers in the range from 26798 to 26750 (permalink). If the search range drops much below 500,000, “false positives” will begin to appear. Feel free to experiment.

Saturday 14 May 2022

A Spider-Fly Problem with a Surprising Solution

I’ve long been familiar with the spider and fly problem and its solution. Although, after reading this article, I realised that I had been focused on an incorrect solution. This was indeed surprising to realise that I’d been deluded all these years. The problem can be stated as follows: a spider and a fly are on opposite walls of a 30 × 12 × 12 meter room. The spider is 1 meter above the floor, the fly is 1 meter below the ceiling. They are both 6 meters from adjacent walls, as shown in Figure 1. If the fly does not move, what is the shortest distance the spider can crawl to reach it?

Figure 1

A sensible first attempt would be to travel straight up (or down) and across. For example, straight up the spider’s wall (11 meters), along the roof (30 meters) and down to the fly (1 meter). See Figure 2. This gives a total distance of 42 meters.

Figure 2

What I believed to be the shortest path is shown in Figure 3 and it is clearly not the shortest path!

Figure 3

In fact the shortest path requires the spider to cross five of the six internal surfaces and this is shown in Figure 4. The shortest path can be seen to be 40 metres.

Figure 4

The site from which this information is taken has some nice animated gifs of the rectangular prism’s unfolding, so the reader is encouraged to visit. The author of the article is Russell Lim, a high school teacher in Melbourne.

Thursday 12 May 2022

Primitive Root

I’m surprised that I haven’t come across this concept before but it was brought to my attention via one of the properties of 26701, my diurnal age on Wednesday, May 11th 2022. It is a member of OEIS A061334: primes with 22 as smallest positive primitive root. The initial members of this sequence are:

3361, 6841, 9439, 13681, 14449, 26591, 26701, 28729, 39373, 40609, 41161, 41521, 
54601, 61031, 66071, 66301, 68041, 68881, 70729, 82021, 85201, 89209, 90217, 93601, 
96769, 104831, 110161, 112921, 117721, 121631, 125329, 126001, 128521

The question that I naturally asked was: what is a primitive root?

This YouTube video provides a good explanation and Figure 1 shows a screenshot of the author’s simplified definition:

Figure 1

Using this definition, it’s easy enough to show that 22 is the smallest primitive root of 26701 (permalink plus see SageMathCell verification below).

Some other larger primitive roots are 26, 29, 38, 47, 59 and 66. In fact, as the calculation above shows, there are a total of \( \phi (\phi(26701)=7040 \) primitive roots where \( \phi \) is the euler totient function. This YouTube link to Michael Penn’s video explains why this is so. What is less apparent however, is the usefulness of finding the primitive root of a prime number. I should investigate this further at some point but I’m still on holidays and my mind in holiday mode.

Friday 6 May 2022

Repdigits

On May 4th 2022, I turned 26694 days old and one of the properties of 26694 is that is a member of OEIS A167782: numbers that are repdigits with length > 2 in some base. Hmmm, but what base? Looking at the table from Numbers Aplenty, it can be seen that none of the bases from 2 to 16 satisfy (see Table 1).


Table 1

Testing out the bases from 17 to 36 (permalink), it can be seen that again there are no repdigits (see Table 2).


Table 2

The reason for stopping at base 36 is that we have run out of letters of the alphabet and need to resort to an alternative system for representing numbers in higher bases. Now I resorted to trial and error. Base 37 didn’t satisfy but base 38 did. I found that \( 18 \times 38^2+18 \times 38 + 18 = 26694 \) which we can write as \(18.18.18_{36} \). Of course, I got lucky. The number may have been a repunit in a much higher base. However, it’s easy to write a program to handle these higher bases and avoid wasting time on manual calculation (permalink). See Table 3.


Table 3

The table above shows representations for bases up to 60 and if nothing showed up in this range then calculations could be extended until the first number in the triplet reaches zero, in which case the length is equal to 2 and the number does not meet the criterion. For 26694, this occurs at base 164 where we find that \(0 \times 164^2+ 162 \times 164 + 126 = 26694\) which we can represent as \( 162.126_{164} \).

The initial members of OEIS A167782 are: 0, 7, 13, 15, 21, 26, 31, 40, 42, 43, 57, 62, 63, 73, 80, 85, 86, 91, 93, 111, 114, 121, 124, 127, 129, 133, 146, 156, 157, 170, 171, 172, 182, 183, 211, 215, 219, 222, 228, 241, 242, 255, 259, 266, 273, 285, 292, 307, 312, 314, 333, 341, 342, 343, 364, 365, 366. The accompanying comments can be found in the OEIS entry: definition requires “length > 2” because all numbers n > 2 are trivially represented as “11” in base n-1. 0 included at the suggestion of Franklin T. Adams-Watters (and others) as 0 = 000 in any base.

The 10,000th such number in the sequence is 583,744 which means that the percentage of such numbers up to that limit is about 1.713% or a little over 17 per thousand. Let’s not confuse repdigits with repunits:
In recreational mathematics, a repunit is a number like 11, 111, or 1111 that contains only the digit 1 — a more specific type of repdigit. The term stands for repeated unit and was coined in 1966 by Albert H. Beiler in his book Recreations in the Theory of Numbers. Wikipedia

All repdigits are multiples of repunits e.g. 666 is a multiple of the repunit 111.