cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A336895 The prime sandwiches sequence (see Comments lines for definition).

Original entry on oeis.org

1, 22, 2, 3, 225, 33, 7, 25, 11, 331, 37, 71, 72, 5, 19, 112, 3312, 9, 373, 17, 13, 77, 24, 15, 54, 31, 94, 712, 53, 32, 59, 99, 6, 133, 67, 177, 113, 73, 777, 92, 4, 8, 315, 89, 549, 731, 10, 194, 103, 7210, 75, 310, 93, 21, 135, 91, 27, 991, 316, 61, 371, 313, 96, 714, 917, 151, 131, 57
Offset: 1

Views

Author

Carole Dubois and Eric Angelini, Aug 07 2020

Keywords

Comments

Imagine we would have a pair of adjacent integers in the sequence like [1951, 2020]. The sandwich would then be made of the rightmost digit of a(n), the leftmost digit of a(n+1) and, in between, the smallest prime p not yet inserted in a sandwich. The pair [1951, 2020] would then produce the sandwich 1p2. Please note that the pair [2020, 1951] would produce the genuine sandwich 0p1 (we keep the leading zero: these are sandwiches after all, not integers).
Now we want the sequence to be the lexicographically earliest sequence of distinct positive terms such that the successive sandwiches emerging from the sequence rebuild it, digit after digit.

Examples

			The first successive sandwiches are: 122, 232, 253, 372, 5113, 3137,...
The 1st one (122) is visible between a(1) = 1 and a(2) = 22 (insert 2).
The 2nd one (232) is visible between a(2) = 22 and a(3) = 2 (insert 3).
The 3rd one (253) is visible between a(3) = 2 and a(4) = 3 (insert 5).
The 4th one (372) is visible between a(4) = 3 and a(5) = 225 (insert 7).
The 5th one (5113) is visible between a(5) = 225 and a(6) = 33 (insert 11); etc.
The successive sandwiches rebuild, digit by digit, the starting sequence.
		

Crossrefs

Cf. A336894 (empty sandwiches), A335600 (poor sandwiches).