Tuesday 27 July 2021

Semiprimes that Approximate Whole Numbers

I've written about semiprimes on many occasions dating back to my earliest posts. These posts are:

Thus far however, I've not considered semiprimes that closely approximate whole numbers. However, today I turned 26413 days old and this number is a semiprime with prime factors of 61 and 433. If the smaller factor is divided into the larger, we get:$$\frac{433}{61} \approx 7.09836065573770$$This is fairly close to 7 but I thought I'd investigate the first one million natural numbers, using SageMathCell, to see which semiprimes yielded the closest approximations. I thought \( \pm 0.1\) was a fair distance limit to set and by this criterion 26413 just sneaks in. Figure 1 shows a table with the initial semiprimes that qualified, ranked in order of successively smaller differences between the ratio of prime factors and 7.


Figure 1: permalink to SageMathCell

What struck me as odd about this table is that 25681 and 26413 have identical differences with the ratio of the former being just below 7 and the latter just above. The reason for this becomes clear once we look at the average of these two numbers, 26047, and compare the factorisation of all three:$$ 25681 =61 \times 421\\26047=7 \times 61^2\\26413=61 \times 433$$Let's rewrite the factorisation of the average so that we have:$$ 25681 =61 \times 421\\26047=61 \times 427\\26413=61 \times 433$$Let's divide all three by \(61^2\) to get:$$ \begin{align} \frac{25681}{61^2}&=\frac{421}{61}=7-\frac{6}{61}\\ \frac{26047}{61^2}&=7\\ \frac{26413}{61^2}&=\frac{433}{61}=7+\frac{6}{61} \end{align} $$Notice how \( \dfrac{6}{61} \approx 0.0983606557377049 <0.1\). Up to one million, there are the following such pairs of semiprimes that are equidistant from 7 because of the same mechanism. See Figure 2.


Figure 2: permalink to SageMathCell

Getting back to the closest approximations to 7, Figure 3 shows the top contenders. It can be seen that, generally speaking, the approximations get closer as the numbers get larger. We can surmise that for there exists semiprimes \(p \times q \) with \(p<q\) such that:$$ \lvert \frac{q}{p}-7 \rvert < \epsilon \text{ for any } \epsilon \text{ , no matter how small}$$

Figure 3: permalink to SageMathCell

So in the range up to one million, there are 307 semiprimes \(p \times q \) that meet the criterion and they all fit in within the brackets as shown in Figure 4. Infinitely many such semiprime ratios can be fitted into the space between the brackets.


Figure 4

These calculations of course can be carried out for any number, not just 7, and the algorithm I developed in SageMath allows for the number to be changed. For example, Figure 5 shows the semiprimes in the range up to one million that approximate 11 most closely within the range \( \pm 0.1 \):


Figure 5: permalink to SageMathCell

Figure 6 shows that there are again pairs of semiprimes that are equidistant from 11, one above and one below:


Figure 6: permalink to SageMathCell

Let's look at the first row in Figure 6: 946097 and 942581 with an average of 944339. This will serve to give us practice in understanding why such pairs exist.$$ 946097 =293 \times 3229\\944339=11 \times 293^2\\942581=293 \times 3217$$Again rewrite the factorisation of the average so that we have:$$ 946097 =293 \times 3229\\944339=293 \times 3223\\942581=293 \times 3217$$Let's divide all three by \(293^2\) to get:$$ \begin{align} \frac{946097}{293^2}&=\frac{3229}{293}=11+\frac{6}{293}\\ \frac{944339}{293^2}&=11\\ \frac{942581}{293^2}&=\frac{3217}{293}=11-\frac{6}{293} \end{align} $$Again we note that \( \dfrac{6}{293} \approx 0.0204778156996587 <0.1\).

Let's designate the whole number that we are interested in as \(n\). So far we've looked at 7 and 11 as specific examples. In general, these semiprime pairs occur when there exists a multiple of \(n\) of the form \(n \times p^2\) where \(p\) is a prime. This number can be written as \(np \times p\). The two semiprimes, one above and one below, must contain this \(p\) as one of their factors with the other factors being \( np-a \) and \( np+a \) respectively, where \(a\) is some integer. Thus we have three numbers in arithmetic progression:$$p \times (np-a), np \times p,p \times (np+a)$$Dividing all terms by \(p^2\) gives:$$n-\frac{a}{p}, \, n, \, n+\frac{a}{p}$$with \(\dfrac{a}{p}\) needing to be less than an agreed size e.g. 0.1.

No comments:

Post a Comment