Showing posts with label prime factor. Show all posts
Showing posts with label prime factor. Show all posts

Friday, 19 April 2024

Unleashing the Full Potential of SageMath


My new M1 Macbook Air is already proving its usefulness as I discovered when exploring the properties of the number associated with my diurnal age today, namely 27401. This number has a property that qualifies it for membership in OEIS 
A197816:


 A197816

Smallest composite number \(m\) such that \(m\) and the greatest prime divisor of \(m\) begin with \(n\).



It took me a while to fully understand what this property involved. Once I did, I developed the algorithm in SageMathCell that is shown in Figure 1 (permalink).


Figure 1

However, the operation times out in SageMathCell which is simply an online implementation of SageMath. In the past, when I used the installation of SageMath on my laptop to address this problem, the laptop would generally freeze up and I would have to reboot it. This laptop was a 2013 Macbook Pro that was clearly not capable of handling the calculations. 

The problem with the algorithm is that after a new value of \(m\) is discovered for a given \(n\), the value of \(n\) needs to reset to 4 every time. This needs to be done 299 times and some of the values for \(m\) are quite large. For example, for \(n\)=114 , the value of \(m\) is 114110. Happily my M1 Macbook Air had no difficulty with the calculation and, after 39 seconds, it spat out the numbers for \(n\) up to 299. Here is the output:

102, 203, 36, 410, 50, 603, 70, 801, 970, 1010, 110, 1270, 130, 1490, 1510, 1630, 170, 1810, 190, 20030, 2110, 2230, 230, 2410, 2510, 2630, 2710, 2810, 290, 3070, 310, 32030, 3310, 3470, 3530, 3670, 370, 3830, 3970, 4010, 410, 4210, 430, 4430, 4570, 4610, 470, 4870, 4910, 5030, 51010, 5210, 530, 5410, 5570, 5630, 5710, 5870, 590, 6010, 610, 62030, 6310, 6410, 6530, 6610, 670, 6830, 6910, 7010, 710, 7270, 730, 7430, 7510, 7610, 7730, 7870, 790, 8090, 8110, 8210, 830, 84190, 8530, 8630, 8770, 8810, 890, 9070, 9110, 9290, 9370, 9410, 9530, 9670, 970, 9830, 9910, 10090, 1010, 10210, 1030, 10490, 10510, 10610, 1070, 10870, 1090, 11030, 11170, 11230, 1130, 114110, 11510, 11630, 11710, 11810, 11930, 12010, 12130, 12230, 12310, 12490, 12590, 126010, 1270, 12830, 12910, 13010, 1310, 13210, 133090, 134110, 135130, 13610, 1370, 13810, 1390, 14090, 141070, 14230, 14330, 14470, 14510, 146210, 14710, 14810, 1490, 150130, 1510, 15230, 15310, 15430, 15530, 15670, 1570, 15830, 15970, 16010, 16130, 16210, 1630, 164110, 16570, 16630, 1670, 168110, 16930, 17090, 171070, 17210, 1730, 17410, 17530, 176090, 17770, 17830, 1790, 18010, 1810, 18230, 18310, 18470, 185030, 18610, 18710, 18890, 189110, 19010, 1910, 192070, 1930, 19490, 19510, 196030, 1970, 19870, 1990, 20030, 20110, 20270, 20390, 204070, 20530, 20630, 207070, 20810, 20990, 210010, 2110, 21290, 21310, 21410, 21530, 21610, 21790, 218030, 219110, 22030, 22130, 22210, 2230, 22430, 22510, 22670, 2270, 22810, 2290, 23090, 23110, 232010, 2330, 23410, 23510, 236030, 23710, 23810, 2390, 240010, 2410, 24230, 24370, 24410, 24590, 24670, 24730, 248090, 249070, 25030, 2510, 25210, 25310, 25430, 25510, 256010, 2570, 258010, 25910, 26090, 26170, 26210, 2630, 26470, 26570, 26630, 26710, 26830, 2690, 27070, 2710, 27290, 27310, 27410, 27530, 27670, 2770, 27890, 27910, 28010, 2810, 282010, 2830, 28430, 28510, 28610, 28790, 28870, 28970, 29030, 29170, 29270, 2930, 294010, 29530, 29630, 29710, 298030, 29990

Thus 27410 is the first number that begins with 274 and has a greatest prime divisor (2741) that also begins with 274. As the OEIS comments state: a majority of numbers are divisible by 10. SageMathCell is a great online resource and most of the time, for the calculations I carry out, it is sufficient but it's nice to know that for more protracted calculations, the SageMath installation on my laptop can now be relied upon.

Wednesday, 27 December 2023

Some Rare Sextuplets and Septuplets

In terms of the numbers associated with my diurnal age, I recently concluded a run of six numbers (a sextuplet) with the shared property that they could all be written as a product of three, not necessarily distinct, prime factors. These were the numbers together with their factorisations:

  • 27290 = 2 * 5 * 2729
  • 27291 = 3 * 11 * 827
  • 27292 = 2^2 * 6823
  • 27293 = 7^2 * 557
  • 27294 = 2 * 3 * 4549
  • 27295 = 5 * 53 * 103

Four of the members of this sextuplet are sphenic but they are not consecutive because, counting from 4, every fourth number is subsequently divisible by 4. As 27290 marks the beginning of this run of numbers, it qualifies for membership in OEIS 
A045942:


 A045942

Numbers \(m\) such that the factorisations of \(m \dots m+5\) have the same number of primes (including multiplicities).



Such numbers are few and far between. The initial members of the sequence are:

2522, 4921, 18241, 25553, 27290, 40313, 90834, 95513, 98282, 98705, 117002, 120962, 136073, 136865, 148682, 153794, 181441, 181554, 185825, 204323, 211673, 211674, 212401, 215034, 216361, 231002, 231665, 234641, 236041, 236634, 266282, 281402, 284344, 285410


As can be seen, I'm unlikely to experience the next number (of days old) which is 40313 by which time I'd be 110 years old. Some of the numbers in this sequence mark the start of a run of seven numbers, a septuplet, and this can be seen in by the two adjacent numbers in the list above (211673 and 211674). 211673 and similar numbers constitute OEIS 
A123103:


 A123103

Numbers \(m\) such that the factorisations of \(m \dots m+6\) have the same number of primes (including multiplicities).



The initial members are:

211673, 298433, 355923, 381353, 460801, 506521, 540292, 568729, 690593, 705953, 737633, 741305, 921529, 1056529, 1088521, 1105553, 1141985, 1187121, 1362313, 1721522, 1811704, 1828070, 2016721, 2270633, 2369809, 2535721, 2590985

Let's look at the septuplet beginning with 211673:

  • 211673 = 7 * 11 * 2749
  • 211674 = 2 * 3 * 35279
  • 211675 = 5^2 * 8467
  • 211676 = 2^2 * 52919
  • 211677 = 3 * 37 * 1907
  • 211678 = 2 * 109 * 971
  • 211679 = 13 * 19 * 857

There are longer runs but the numbers then become very large: A358017 (\(k=8\)), A358018 (\(k=9\)), A358019 (\(k=10\)).

ADDENDUM: March 6th 2024

Today I created a post that more or less reproduced what I've covered here. I had to delete it because it was largely redundant. Now that I have so many posts it's important that I check first before I create posts. The hashtags become very important in this context.

Monday, 16 October 2023

Collatz-2 Trajectory

Collatz Trajectory:

The Collatz trajectory of a number \(n\) is defined as follows:$$ \begin{align} n &\rightarrow \frac{n}{2} \text{ if } n \text{ is even}\\n &\rightarrow 3n+1 \text{ if n is odd} \end{align}$$The Collatz conjecture is that the trajectory of all numbers eventually ends in 1 and this has not yet been proven. Most numbers reach 1 quickly but some numbers require far more steps e.g.  6,171 requires 261 steps. 

Pn + 1 Trajectory:

The Collatz trajectory is sometimes referred to as the 3\(n\)+1 trajectory and generalisation of this is the P\(n\)+1 trajectory of which the Collatz trajectory is the special case of P=\(3\). Let's consider the case of P=17 where 17\(n\)+1 is defined as:$$ \begin{align} n &\rightarrow \frac{n}{2^{a} . 3^{b} . 5^{c} . 7^{d}  . 11^{e}  . 13^{f}} \\ \\ \text{ where } a,b,c,d,e,f &\geq 0 \text{ and } 2^{a} \text{ is a factor of } n \text{ if } a>0 \text{ etc. }\\ \text{and not all }a,b,c,d,e &=0 \text{ because denominator is then 1}\\ \text{if all } a,b,c,d,e &=0 \text{ then denominator is 1 and }\\ \\ n &\rightarrow 17n+1 \end{align} $$Here is the trajectory of 61 under these rules:

61, 1038, 173, 2942, 1471, 25008, 521, 8858, 4429, 75294, 4183, 71112, 2963, 50372, 257, 4370, 437, 7430, 743, 12632, 1579, 26844, 2237, 38030, 3803, 64652, 2309, 39254, 19627, 333660, 5561, 94538, 47269, 803574, 14881, 252978, 3833, 65162, 32581, 553878, 263, 4472, 43, 732, 61

As can be seen, the trajectory loops back to the starting point. Figure 1 shows its graph with a peak of 803574 being reached:


Figure 1: permalink

While some numbers have a looping trajectory, the majority terminate in 1. Another prime, 41, is an example of this with Figure 2 graphing the trajectory.

41, 698, 349, 5934, 989, 16814, 1201, 20418, 3403, 57852, 1607, 27320, 683, 11612, 2903, 49352, 6169, 104874, 227, 3860, 193, 3282, 547, 9300, 31, 528, 1, 18, 1


Figure 2

PrimeLatz Trajectory:

The PrimeLatz Trajectory is similar except that for odd numbers, the rule is to add the next three primes to the number. This will always generate an even number that is then divided by 2. The PrimeLatz Conjecture is that the sequence of numbers thus generated will always lead to a loop.

The trajectory of 61 is 61, 272, 136, 68, 34, 17, 88, 44, 22, 11, 60, 30, 15, 74, 37, 168, 84, 42, 21, 104, 52, 26, 13, 72, 36, 18, 9, 50, 25, 122, 61 with Figure 3 showing the graph where a maximum of 272 is reached:


Figure 3

Esucarys Trajectory

The Esucarys sequence derives its name from a reversal of "Syracuse", with the generating rule being that for the Syracuse (3\(n\)+1 or Collatz) sequence followed by a reversal. 247 is the only known fixed point of the Esucarys sequence. Very few numbers map to 247. The members of this sequence, up to 40,000, are:

247, 1247, 1484, 2473, 4859, 5087, 5738, 7318, 7484, 9563, 9682, 9694, 9938, 11247, 12189, 12473, 14840, 14842, 15209, 15610, 16274, 16563, 16750, 16798, 17609, 19168, 20019, 21885, 24733, 26251, 27123, 27125, 29156, 30076, 30524, 32614

Figure 4 shows the trajectory of 26251:


Figure 4

All other numbers simply increase without bound. So much for the review of what I've covered in earlier posts. Now it's time for the Collatz-2 trajectory.

Collatz-2 Trajectory

This trajectory is defined by a generalization of the classical '3\(n\)+1' function: instead of dividing an even number by 2 a non-prime will be divided by its smallest prime factor and a prime will be multiplied not by 3 but by its prime-predecessor, before one is added. Thus:$$ \begin{align} \text{for } n \text{ composite: } n &\rightarrow \frac{n}{\text{smallest prime factor}}\\ \text{for } n \text{ prime: }n &\rightarrow n \times \text{ previous prime} \end{align}$$Most numbers will have a trajectory that ends in 2 while others will enter a loop and yet still others will return to their starting points (and thus loop as well). 29 is an example of a number that returns to its starting point. It's trajectory is 29, 668, 334, 167, 27222, 13611, 4537, 349, 121104, 60552, 30276, 15138, 7569, 2523, 841, 29 (permalink). Figure 5 shows its trajectory:


Figure 5: 
permalink

Sunday, 6 August 2023

Hidden Beast Numbers

The number associated with my diurnal age today, 27153, gave me the idea for what I'm terming "hidden beast numbers". This number factorises to 3 x 3 x 7 x 431 and its sum of prime factors, with multiplicity, is 444. This prompted me to find all numbers whose sum of prime factors have identical digits. This sequence does not appear in the OEIS but I added it to my Bespoken for Sequences.

However, in this post I'm only interested in those numbers whose prime factors add to 666, the so-called "number of the beast". Obviously in numbers like 27666, the three sixes are scarcely hidden but in a number like: $$ 998515 = 5 \times 7 \times 47 \times 607$$the three sixes are not so obvious. It is only when we add the 5, 7, 47 and 607 together that find the 666.

The 248 numbers (excluding numbers whose sum is a single digit) with this property are as follows (permalink) up to one million:

3305, 3966, 4613, 6590, 7908, 8489, 12293, 14366, 14789, 21998, 29093, 29486, 32489, 35813, 36568, 40133, 41139, 43289, 46373, 48868, 48975, 51353, 52240, 55193, 57989, 57998, 58770, 60713, 62688, 67288, 70524, 75699, 78244, 79913, 81989, 83333, 84206, 87173, 87448, 92933, 97432, 98379, 98789, 99653, 100889, 105113, 106468, 106755, 106793, 107753, 108389, 109289, 109611, 110213, 110489, 110633, 113726, 113872, 119198, 128106, 146392, 146644, 158515, 163455, 164691, 169886, 174352, 175539, 183998, 190218, 196146, 200846, 203032, 208975, 210926, 212248, 215246, 219566, 219998, 226450, 228411, 230488, 232683, 238779, 247555, 250770, 257368, 259299, 267488, 271740, 283672, 289539, 289856, 290788, 291655, 292312, 297066, 300924, 317848, 319131, 323500, 325348, 326088, 328851, 342808, 345499, 349986, 353650, 357579, 366849, 368548, 379455, 383128, 385659, 388200, 391588, 396628, 404752, 405844, 406552, 414080, 416650, 424380, 429028, 431019, 436725, 436888, 436948, 438244, 441098, 452672, 455346, 457371, 458968, 465840, 467571, 480963, 491499, 493570, 494488, 496896, 499980, 507955, 509256, 516339, 524070, 530115, 533312, 553539, 556299, 559008, 565456, 572575, 572913, 573208, 579352, 592284, 599976, 609546, 614872, 625155, 628884, 630140, 631768, 636138, 644859, 651771, 658975, 659395, 666832, 674008, 674973, 687090, 691731, 693592, 697255, 705100, 710739, 721048, 725650, 729688, 732896, 733912, 748371, 750186, 756168, 757912, 758259, 759615, 780291, 786328, 789592, 790770, 791274, 799015, 804952, 807832, 810256, 811179, 820899, 821272, 824508, 825651, 825979, 835288, 836706, 843352, 843488, 843855, 846120, 848728, 850689, 851992, 852651, 860248, 866968, 868312, 868888, 870780, 879452, 879655, 884559, 884619, 888291, 900112, 900200, 902528, 905571, 908811, 911538, 912543, 923931, 928832, 939699, 948771, 948924, 951885, 954819, 957243, 958491, 958818, 967779, 975339, 976851, 977499, 979179, 992563, 998515

Looking through this list we see that there is only one number that contains, overtly, the sequence 666. The number is: $$ 666832 = 2 \times 2 \times 2 \times  2 \times 71 \times 587 $$So this number is rather special in that it contains both on overt and covert 666 sequence. Of course, if we consider only distinct prime factors, ignoring multiplicity, we get a different list with only 192 members and with some numbers in common between the two lists. Permalink.

3305, 3966, 4613, 6590, 7932, 8489, 11898, 12293, 13180, 14366, 14789, 15864, 16525, 21998, 23796, 26360, 28732, 29093, 29486, 31728, 32291, 32489, 32950, 35694, 35813, 40133, 43289, 43996, 46373, 47592, 51353, 52720, 55193, 57464, 57989, 57998, 58972, 60713, 63456, 65900, 71388, 79913, 81989, 82625, 83333, 84206, 87173, 87992, 92933, 95184, 98789, 99653, 100889, 105113, 105440, 106755, 106793, 107082, 107753, 108389, 109289, 110213, 110357, 110489, 110633, 113726, 114928, 115996, 117944, 119198, 126912, 131800, 142776, 158026, 163455, 164750, 168412, 169886, 175539, 175984, 183998, 190368, 200846, 210880, 210926, 214164, 215246, 219566, 219998, 226037, 227452, 229856, 231992, 233567, 235888, 238396, 247555, 250770, 253824, 263600, 285552, 291655, 297066, 316052, 320265, 321246, 329500, 336824, 339772, 340147, 349986, 351968, 367996, 373966, 379455, 380736, 401692, 413125, 421760, 421852, 428328, 430492, 439132, 439996, 454904, 459712, 463984, 467571, 471776, 476792, 480963, 490365, 493570, 501540, 507648, 507955, 526617, 527200, 530115, 533775, 553539, 571104, 594132, 609546, 625155, 632104, 642492, 659000, 659395, 673648, 678178, 679544, 687090, 697255, 699972, 703936, 735992, 747932, 748371, 752310, 759615, 761472, 790770, 791274, 799015, 803384, 817275, 823750, 825979, 836706, 843520, 843704, 843855, 856656, 860984, 878264, 879655, 879992, 884559, 891198, 909808, 912543, 919424, 927968, 943552, 953584, 957243, 958818, 960795, 963738, 987140, 998515

Looking through the list, the first new number to appear is 11898 with the property that: $$ 11898 = 2 \times 3 \times 3 \times 661$$In this number, we ignore the second 3 and thus the sum is 2 + 3 + 661 = 666.