Showing posts with label greatest. Show all posts
Showing posts with label greatest. 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.

Tuesday, 27 February 2024

Idoneal Numbers

Euler's numeri idonei or idoneal numbers (suitable or convenient numbers) were included in four papers that Euler presented to the Petersberg Academy in 1778. They are:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 21, 22, 24, 25, 28, 30, 33, 37, 40, 42, 45, 48, 57, 58, 60, 70, 72, 78, 85, 88, 93, 102, 105, 112, 120, 130, 133, 165, 168, 177, 190, 210, 232, 240, 253, 273, 280, 312, 330, 345, 357, 385, 408, 462, 520, 760, 840, 1320, 1365, 1848

The property that these numbers share is that they cannot be represented in the form \( ab+ac+bc \) with \(0 < a < b < c\). While 1848 is the largest known number, this source states that:

S. Chowla proved (in 1934) that the number of numeri idonei is finite, and it is known that there can be at most ONE more square-free numerus idoneus beyond those found by Euler.  Whether such another number exists is still an open question.

However, another source states that 1848 is the largest number if the Riemann Hypothesis hold true otherwise what's said above will hold.

I came across the reference to these numbers when investigating the number associated with my diurnal age today, namely 27358. It is a member of OEIS


  A094377

Greatest number having exactly n representations as \(ab+ac+bc \) with \(0 < a < b < c\).



Up to 40,000, the initial members of this sequence are:

1848, 193, 1012, 862, 3040, 2062, 4048, 3217, 7392, 4162, 7837, 8002, 12397, 13297, 14722, 16417, 21253, 21058, 30493, 27358, 34357, 34318

Here we see 1848 appearing as the greatest number for the case of \(n=0\), in other words it cannot be represented in this way. On the other hand, 193 is the greatest number that can be represented in only one way, namely:$$193=4 \times 7 + 4 \times 15 + 7 \times 15\\ \text{where } a=4, b=7 \text{ and } c=15$$27358 corresponds to the case of \(n=19\), in other words this number can be represented in 19 different ways in the form \(ab+ac+bc \). Here are 18 of them with one missing that I haven't been able to find.
  • 5 - 134 - 192
  • 14 - 32 - 585
  • 19 - 34 - 504
  • 23 - 56 - 330
  • 26 - 81 - 236
  • 26 - 105 - 188
  • 29 - 134 - 144
  • 30 - 41 - 368
  • 30 - 112 - 169
  • 34 - 72 - 235
  • 35 - 66 - 248
  • 44 - 53 - 258
  • 44 - 107 - 150
  • 56 - 102 - 137
  • 57 - 70 - 184
  • 66 - 91 - 136
  • 71 - 108 - 110
  • 9 - 14 - 1184
There's a lot more to this topic but let's return to the idoneal numbers and find out why they are "convenient". Well, they are convenient because they were used historically to help find large primes using the formula:$$x^2+n\, y^2\\ \text{ where } n \text{ is a convenient number}$$For example, Euler was able to find the prime:$$18,518,809=197+1848 \times 100$$where as can be seen the largest convenient number makes its appearance. If we replace 197 with other primes, we find that in the prime range up to 600, 46.3% of the resultant numbers are prime (permalink). It would be interesting to see how this figure compares to others using different convenient numbers and/or different values of \(x\) and \(y\).

This is a fairly deep topic and I won't go further into it here but it's clear that the idoneal numbers are a small but fascinating group.