Tuesday, July 21, 2020

An interesting prime sequence

The sequence starts 2, 3, 11, 23, 29, 61, 19, 113, 157, 127, 103, ... These are the red endings of the following (second column) triangular array. The first column numbers are the indices. The third column numbers are the sums of the digits of the second column integers.

There are several constraints imposed in creating our sequence. Each successive term must be a distinct prime. It must be the smallest such prime that allows the following: At index k, take the final k digits of the sequence. The first of those final k digits must not be zero in order that we may have the concatenation of those digits be a k-digit prime (these are our middle numbers). Finally, the sum of those k digits (the third column) must also be a prime.

  1  2  2
  2  23  5
  3  311  5
  4  1123  7
  5  12329  17
  6  232961  23
  7  3296119  31
  8  96119113  31
  9  119113157  29
 10  9113157127  37
 11  13157127103  31
 12  315712710343  37
 13  5712710343149  47
 14  71271034314989  59
 15  271034314989701  59
 16  7103431498970113  61
 17  10343149897011341  59
 18  343149897011341751  71
 19  3149897011341751379  83
 20  49897011341751379499  101
 21  897011341751379499373  101
 22  9701134175137949937397  109
 23  11341751379499373971223  101
 24  341751379499373971223293  113
 25  1751379499373971223293601  113
 26  13794993739712232936011471  113
 27  949937397122329360114711303  109
 28  9937397122329360114711303223  103
 29  73971223293601147113032231297  101
 30  712232936011471130322312973547  101
 31  2232936011471130322312973547619  109
 32  32936011471130322312973547619769  127
 33  936011471130322312973547619769683  139
 34  6011471130322312973547619769683433  137
 35  11471130322312973547619769683433503  139
 36  471130322312973547619769683433503563  151
 37  7113032231297354761976968343350356337  157
 38  13032231297354761976968343350356337239  163
 39  322312973547619769683433503563372395333  173
 40  2312973547619769683433503563372395333337  181
 41  12973547619769683433503563372395333337311  181
 42  297354761976968343350356337239533333731147  191
 43  9735476197696834335035633723953333373114771  197
 44  35476197696834335035633723953333373114771673  197
 45  761976968343350356337239533333731147716731889  211
 46  9769683433503563372395333337311477167318895801  211
 47  69683433503563372395333337311477167318895801211  199
 48  683433503563372395333337311477167318895801211409  197
 49  3433503563372395333337311477167318895801211409277  199
 50  33503563372395333337311477167318895801211409277313  199
 51  356337239533333731147716731889580121140927731311003  193
 52  3372395333337311477167318895801211409277313110031607  193
 53  23953333373114771673188958012114092773131100316071109  191
 54  953333373114771673188958012114092773131100316071109281  197
 55  3333731147716731889580121140927731311003160711092811381  193
 56  33731147716731889580121140927731311003160711092811381613  197
 57  311477167318895801211409277313110031607110928113816133361  197
 58  4771673188958012114092773131100316071109281138161333611103  197
 59  71673188958012114092773131100316071109281138161333611103263  197
 60  731889580121140927731311003160711092811381613336111032631283  197
 61  8895801211409277313110031607110928113816133361110326312834153  199
 62  58012114092773131100316071109281138161333611103263128341531697  197
 63  121140927731311003160711092811381613336111032631283415316971039  197
 64  1140927731311003160711092811381613336111032631283415316971039179  211
 65  40927731311003160711092811381613336111032631283415316971039179347  223
 66  277313110031607110928113816133361110326312834153169710391793472971  229
 67  7313110031607110928113816133361110326312834153169710391793472971151  227
 68  13110031607110928113816133361110326312834153169710391793472971151349  233
 69  100316071109281138161333611103263128341531697103917934729711513492351  239
 70  3160711092811381613336111032631283415316971039179347297115134923513943  257
 71  60711092811381613336111032631283415316971039179347297115134923513943541  263
 72  110928113816133361110326312834153169710391793472971151349235139435411459  269
 73  9281138161333611103263128341531697103917934729711513492351394354114592617  283
 74  81138161333611103263128341531697103917934729711513492351394354114592617137  283
 75  138161333611103263128341531697103917934729711513492351394354114592617137937  293
...

I'm indebted to Éric Angelini for the seed of the idea.

Saturday, July 11, 2020

Rev it up

Under the direction of Mark "rogue" Rodenkirch in mersenneforum, on June 28 I was able to run a probable-prime search/verification program that executes some six times faster than what I can do in Mathematica. Considering that Mathematica is what I have been using for my large-Leyland-prime search for almost five years now, that's an awful lot of wasted time!

In order to more efficiently use this program (OpenPFGW; OS X version, pfgw64), a prime-sieving algorithm (OS X version, xyyxsieve) was recommended as a precursor, in order to trim the available candidate numbers to a much-lesser amount. In Mathematica such a routine is incorporated in its PrimeQ function but PrimeQ will not go beyond its built-in limit. So, on July 2 I ran my first prime sieve.

This is a game changer for me. On Wednesday afternoon, a storm knocked out the power here for longer than I had computer battery-backup.


As a result, my Leyland prime search for interval #9 was interrupted. It was scheduled for completion July 25 but recent experience suggested that it would not actually have finished until a week into August. So I used the heavenly portent to convert my remaining search-space into a format that I could use for xyyxsieve and, subsequently, pfgw64. A lot of ongoing manual fiddling and such was needed for the conversions but this allowed me to get used to the new processes. This morning it completed the searches!