Thursday 12 January 2023

Rotate and Add

26947 is a prime, in fact it's a left truncatable prime. This means that with successive removal of digits from the left, the resulting number is still prime. Thus we have 6947, 947, 47 and 7 all being prime. The number was brought to my attention because it represents my diurnal age today: 12th January 2023. Coincidentally if we write this date as 12-1-2023 and then concatenate the digits to form 1212023, this number too is prime.

However, 26947 is also of interest in connection to a so-called rotate and add operation that can be applied to any integer number. If the number has an even number of digits, let's say 1234, then we divide the number into two parts of equal length (12|34) and swap the two parts (34|12) to form 3412. If the number has an odd number of digits, let's say 12345, then we leave the central digit unchanged (12|3|45) but swap the left and right hand parts (45|3|12) to form 45312.

Let's consider primes in the range up to 1000. How many of them will remain prime under this operation. These are the primes that remain prime:

229, 239, 241, 257, 269, 271, 277, 281, 439, 443, 463, 467, 479, 499, 613, 641, 653, 661, 673, 677, 683, 691, 811, 823, 839, 863, 881

Let's take 229 as an example. The operation leads to its rotation (where it becomes 922) and its addition to its rotated form (229 + 922) leads to 1151 which is prime. Primes such as these form OEIS A086002:


 A086002

Primes which when added to their own rotation yield a prime.     
                     


26947 is one such prime because its rotation (47926) and its addition to this rotation (26947 + 47926) generates the prime 74873. However, when the operation is applied to this new prime, the result is still a prime. This is because 74873 + 73874 = 148747 which is prime. Primes such as this are much rarer and constitute OEIS A086003:


 A086003

Primes which remain prime after one and after two applications of the rotate-and-add operation of A086002.



The initial members of this sequence are:

271, 281, 10853, 10903, 10939, 12917, 12919, 16603, 16673, 16823, 16843, 18671, 18911, 18913, 20929, 22817, 22907, 24907, 26813, 26833, 26903, 26947, 28661, 28901, 28921, 30809, 30829, 32831, 32917, 32941, 34939, 36653, 36913, 38651

Unfortunately, if we repeat the process, 26947 does not survive but other numbers do and these constitute OEIS A086004


 A086004

Primes which remain prime after one and after two and after three applications of the rotate-and-add operation of A086002.



The initial members of this sequence are (permalink):

12917, 12919, 18911, 18913, 22907, 24907, 26903, 28901, 1088063, 1288043, 1408031, 1428029, 1528019, 100083679, 100280419, 100283849, 100483847, 100692793, 100880413, 101080159, 101283839, 101683093, 101683663, 102080149

None of the primes listed above survive another round but there are larger primes that do and these constitute OEIS A261458:


 A261458

Primes which remain prime after one, two, three and four applications of the rotate-and-add operation of A086002.



The initial members of this sequence are:

10010905789, 10028905771, 10036905763, 10050905749, 10056905743, 10060905739, 10070905729, 10080905719, 10092905707, 10098905701, 10102905697, 10106905693, 10108905691, 10112905687, 10130905669, 10160905639, 10172905627, 10176905623, 10188905611, 10190905609 

In general, it can be noted that rotation and addition of primes with even numbers of digits never yields a prime. This can be seen, using \(ab\) as an example because the rotation \(ba\) and addition generates \(10a+b+10b+a=11a+11b=11 \times (a+b)\) which is composite.

As far as I know, no primes have been found that survive five applications of the operation and according the the comments to OEIS A261458 six applications can never generate a prime.

The rotate and add operation of course does not need to be confined to primes. For example. we could consider semiprimes that remain semiprimes under one, two, three etc. applications of the operation. Such an investigation could form the basis of a future post.

No comments:

Post a Comment