A Skolem/Langford-like sequence with primes

September 18th, 2006

Hello SeqFan and Math-Fun,

Consider this sequence S:

S=2 3 5 2 11 3 2 17 5 2 23 7 2 41 5 2 11 13 2 7 5 2 47 29 2 17 5 2 11 19 2 13 5 2 23 31 2...

Definition:

Pick any term T in S (11 for instance): there are T primes between this term T and the closest next T of S (left or right).

[There are indeed 11 primes between (any) two 11 in the sequence]:

S=2 3 5 2 11 3 2 17 5 2 23 7 2 41 5 2 11 13 2 7 5 2 47 29 2 17 5 2 11 19 2 13 5 2 23 31 2...

This Skolem-like prime sequence has been built according to those rules:

(I wanted only primes to appear in the sequence -- and possibly all of them)

Start with 2 and fill accordingly as many boxes as possible to the right:

S=2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . etc.

We *must* now find a place for at least two 3; lets try with the *first* empty box:

S=2 3 . 2 . 3 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 .  etc.

There is room for only two 3 -- a third 3 would have to be put in place of the underlined 2 -- which is not possible. If a third 3 is put somewhere else in an empty box to the right, we would have more than three primes between this third 3 and the second one. So we have only two 3 in the whole sequence.

We *must* now find a place for at least two 5; lets try with the *first* empty box:

S=2 3 5 2 . 3 2 . 5 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 . . 2 ., etc.

There is room for a pair odf 5 -- but can we add some more 5 to the right? -- Yes, plenty of them (infinitely many -- as we had with 2):

S=2 3 5 2 . 3 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 ., etc.

We *must* now find a place for at least two 7; lets try with the *first* empty box:

S=2 3 5 2 7 3 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 ., etc.

It *doesnt* work! There is no room for the second (at least) 7 (its box is taken by the underlined 2)

Lets forget this try and go to the *next* empty box with our first 7. Is there room there for the second one? No, neither!

S=2 3 5 2 . 3 2 7 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 ., etc.

After another miss with the third empty box, well have a hit on the fourth:

S=2 3 5 2 . 3 2 . 5 2 . 7 2 . 5 2 . . 2 7 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 ., etc.

Can we fill more boxes to the right with a few 7? No -- so lets proceed.

We *must* now find a place for at least two 11; lets try with the *first* empty box:

S=2 3 5 2 11 3 2 . 5 2 . 7 2 . 5 2 11 . 2 7 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 . . 2 . 5 2 ., etc.

It works -- and there is room for (infinitely) more 11 to the right:

S=2 3 5 2 11 3 2 . 5 2 . 7 2 . 5 2 11 . 2 7 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . . 2 . 5 2 11 . 2 . 5 2 . , etc.

We *must* now find a place for at least two 13; etc.

(etc.)

The sequence S will look like this after 2,3,5,7,11,13,17,19,23,29,31,37,41, have been placed (terms computed by Gilles Sadowski):

S=2 3 5 2 11 3 2 17 5 2 23 7 2 41 5 2 11 13 2 7 5 2 47 29 2 17 5 2 11 19 2 13 5 2 23 31 2 53 5 2 11 59 2 17 5 2 191 37 2 19 5 2 11 29 2 41 5 2 23 43 2 17 5 2 11 61 2 31 5 2 47 67 2 83 5 2 11 71 2 17 5 2 23 29 2 37 5 2 11 73 2 53 5 2 239 79 2 17 5 2 11 59 2 43 5 2 23 89 2 101 5 2 11 29 2 17 5 2 47 97 2 113 5 2 11 103 2 61 5 2 23 107 2 17 5 2 11 109 2 67 5 2 383 29 2 53 5 2 11 71 2 17 5 2 23 127 2 83 5 2 11 59 2 73 5 2 47 131 2 17 5 2 11 29 2 79 5 2 23 137 2 227 5 2 11 139 2 17 5 2 479 163 2 149 5 2 11 89 2 53 5 2 23 29 2 17 5 2 11 179 2 101 5 2 47 157 2 97 5 2 11 59 2 17 5 2 23 151 2 103 5 2 11 29 2 113 5 2 191 107 2 17 5 2 11 181 2 109 5 2 23 167 2 53 5 2 11 193 2 17 5 2 47 29 2 197 5 2 11 211 2 173 5 2 23 223 2 17 5 2 11 59 2 127 5 2 431 89 2 263 5 2 11 29 2 17 5 2 23 131 2 233 5 2 11 199 2 53 5 2 47 229 2 17 5 2 11 137 2 293 5 2 23 29 2 139 5 2 11 241 2 17 5 2 239 269 2 251 5 2 11 59 2 149 5 2 23 107 2 17 5 2 11 29 2 163 5 2 47 257 2 53 5 2 11 283 2 17 5 2 23 271 2 157 5 2 11 89 2 151 5 2 719 29 2 17 5 2 11 179 2 419 5 2 23 281 2 359 5 2 11 59 2 17 5 2 47 307 2 227 5 2 11 29 2 53 5 2 23 167 2 17 5 2 11 277 2 181 5 2 191 131 2 353 5 2 11 313 2 17 5 2 23 29 2 173 5 2 11 317 2 193 5 2 47 107 2 17 5 2 11 59 2 197 5 2 23 89 2 53 5 2 11 29 2 17 5 2 863 311 2 211 5 2 11 397 2 449 5 2 23 331 2 17 5 2 11 347 2 223 5 2 47 29 2 199 5 2 11 367 2 17 5 2 23 389 2 401 5 2 11 59 2 53 5 2 383 337 2 17 5 2 11 29 2 233 5 2 23 373 2 229 5 2 11 349 2 17 5 2 47 379 2 263 5 2 11 89 2 467 5 2 23 29 2 17 5 2 11 179 2 241 5 2 239 409 2 53 5 2 11 59 2 17 5 2 23 167 2 251 5 2 11 29 2 443 5 2 47 421 2 17 5 2 11 269 2 491 5 2 23 433 2 293 5 2 11 257 2 17 5 2 191 29 2 509 5 2 11 461 2 53 5 2 23 439 2 17 5 2 11 59 2 271 5 2 47 89 2 283 5 2 11 29 2 17 5 2 23 487 2 197 5 2 11 499 2 521 5 2 479 457 2 17 5 2 11 281 2 503 5 2 23 29 2 53 5 2 11 463 2 17 5 2 47 523 2 617 5 2 11 59 2 277 5 2 23 557 2 17 5 2 11 29 2 307 5 2 431 541 2 569 5 2 11 547 2 17 5 2 23 577 2 563 5 2 11 89 2 53 5 2 47 29 2 17 5 2 11 179 2 313 5 2 23 167 2 359 5 2 11 59 2 17 5 2  etc.

Im not sure if there will be room for every prime; not sure either if the sequence is infinite (or correct so far)!

Is this of interest?

Best,

Ι.