Saturday, 7 January 2023

A Prime and Semiprime Generating Quadratic Polynomial

The quadratic \(2n^2+29\) is especially adept at generating primes and semiprimes. Initially it generates 29 distinct primes for \(n = 0, 1, \dots, 28\). The primes are:

29, 31, 37, 47, 61, 79, 101, 127, 157, 191, 229, 271, 317, 367, 421, 479, 541, 607, 677, 751, 829, 911, 997, 1087, 1181, 1279, 1381, 1487, 1597

When \(n=29\), the first semiprime, 1711 = 29 x 59 is generated. This is in fact how I first encountered this quadratic. My diurnal age today is 26941 and this number is a member of OEIS A241554:


 A241554

Semiprimes generated by the polynomial 2 * n^2 + 29                                     

 The initial members of the sequence are:

1711, 1829, 2077, 2479, 3071, 3901, 5029, 6527, 6757, 7471, 7967, 8479, 10397, 10981, 11581, 14141, 15167, 15517, 15871, 16591, 16957, 17701, 18079, 18847, 19631, 20837, 22927, 23791, 25567, 26941, 27877, 28829, 29797, 30287, 31279, 31781, 32287, 35941, 38117

In the range from 0 to 1000 (1001 numbers overall),  there are:

  • 497 primes or about 49.7%
  • 446 semiprimes or about 44.6%
  • 58 triprimes or about 0.58%

There are no numbers with more than three factors. The first triprime is reached when \(n=185\) and this is \(68479 = 31 \times 47^2\) and this is also the first square-free number as well. This means that none of the previous semiprimes are square numbers.

The first composite numbers with four prime factors is reached when \(n=1334\) and this is 3559141 = 29 x 31 x 37 x 107. In the range up to 5000, there are only twenty such numbers. These are:

  • 1334 --> 3559141 = 29 * 31 * 37 * 107
  • 1704 --> 5807261 = 31 * 37 * 61 * 83
  • 2444 --> 11946301 = 37 * 61 * 67 * 79
  • 2958 --> 17499557 = 29 * 37 * 47 * 347
  • 3132 --> 19618877 = 29 * 31 * 139 * 157
  • 3481 --> 24234751 = 47 * 61 * 79 * 107
  • 3628 --> 26324797 = 31 * 37 * 59 * 389
  • 3688 --> 27202717 = 31 * 59 * 107 * 139
  • 3857 --> 29752927 = 29 * 47 * 83 * 263
  • 3945 --> 31126079 = 47 * 79 * 83 * 101
  • 3998 --> 31968037 = 31 * 37 * 47 * 593
  • 4031 --> 32497951 = 29 * 31 * 37 * 977
  • 4186 --> 35045221 = 31 * 47 * 67 * 359
  • 4277 --> 36585487 = 31 * 59 * 83 * 241
  • 4327 --> 37445887 = 37 * 47 * 61 * 353
  • 4438 --> 39391717 = 37 * 83 * 101 * 127
  • 4640 --> 43059229 = 29 * 61 * 101 * 241
  • 4775 --> 45601279 = 31 * 37 * 83 * 479
  • 4859 --> 47219791 = 67^3 * 157
  • 4930 --> 48609829 = 29 * 31 * 139 * 389
Overall, in the range up to 5000, there are:

  • 1920 primes or about 38%
  • 2436 semiprimes or about 49%
  • 625 triprimes or about 12.5%
  • 20 other composite numbers (listed above) or less than 0.5%
If we extend the range to 10000, there are (permalink):
  • 3484 primes or about 35%
  • 4904 semiprimes or about 49%
  • 1540 triprimes or about 15.5%
  • 73 other composite numbers or about 0.5%
In the range up to 100000 there are:
  • 27545 primes or about 27%
  • 46605 semiprimes or about 47%
  • 22575 triprimes or about 23%
  • 3276 other composite numbers or about 3%
Thus as the range increases, the percentage of primes steadily decreases (49.7% --> 38% --> 35% --> 27%) while the percentage of semiprimes remains fairly steady (44.6% --> 49% --> 49% --> 47%). Overall, this quadratic would seem to be best at producing semiprimes and at a steady rate of almost 50%.

I do make passing reference to this quadratic polynomial in a post from February 26th 2022 titled Another Prime Generating Polynomial. It appears in the following table:


As can be seen, \(2n^2+29\) makes an appearance together with \(2n^2+11\), these being the only quadratic polynomials without a linear term. I also have an earlier post from March 18th 2020 titled Prime Generating Quadratic Polynomials.

No comments:

Post a Comment