Tuesday 26 March 2024

Semiprime Runs

Looking at the number associated with my diurnal age today (27386), I noticed that it marked the end of a run of five almost consecutive semiprimes, with only one number that was not a semiprime intervening. Five consecutive semiprimes are not possible because every fourth number must be a multiple of 4 and thus have at least three factors. See Figure 1.


Figure 1

This got me thinking about how common such an occurrence was. As it turns out, not very. In the range up to one million, there are only 211 such numbers (permalink). Up to 40,000, the numbers are:

146, 206, 218, 219, 303, 699, 1142, 1766, 3903, 4538, 6002, 7118, 7863, 9939, 11762, 14258, 16442, 20019, 20283, 22238, 27386, 27519, 27663, 32138, 34418, 35198, 36123, 38163, 38942, 39687

In my SageMath algorithm to find these numbers, I excluded semiprimes that were square numbers but the algorithm is easily modified to include these if necessary (permalink). In the range up to one million, there are 214 such numbers with the smallest being 123:

  • \(123 = 3 \times 41 \)
  • \(122 = 2 \times 61 \)
  • \(121 = 11^2\)
  • \(120 = 2^3 \times 3 \times 5\)
  • \(119 = 7 \times 17\)
  • \(118 = 2 \times 59\)
What about runs of six almost consecutive numbers, that is six semiprimes in a row with only one number that is not a semiprime intervening. These are predictably rather scarce. Excluding semiprimes again and in the range up to one million, there are only seven such numbers and they are (permalink):

219, 143103, 194763, 206139, 273423, 684903, 807663

As can seen, 219 is the first member of this sequence of numbers and its run is as follows:

  • \(219 = 3 \times 73\)
  • \(218 = 2 \times 109\)
  • \(217 = 7 \times 31\)
  • \(216 = 2^3 \times 3^3\)
  • \(215 = 5 \times 43\)
  • \(214 = 2 \times 107\)
  • \(213 = 3 \times 71\)
While runs of seven almost consecutive semiprimes should be possible, the SageMath algorithm times out when searching online beyond one million. I have in the past downloaded SageMath to my laptop so that I could search beyond the imposed online limits but my 2013 Macbook Pro seizes up when attempting this.

No comments:

Post a Comment