A138568 Erroneous duplicate of A136094.
1, 212, 3212321, 4321234321234, 543212345432123454321, 6543212345654321234565432123456, 7654321234567654321234567654321234567654321
Offset: 1
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.
1, 2, 3, 1, 2, 3, 1 contains as a subsequence all of 123, ..., 321 and is minimal, so a(3) = 7. From _John W. Layman_, Aug 29 2008: (Start) The following is a sequence of length a(5)=19 with terms from 1,2,...,5 that contains as subsequences all of the 120 permutations of 1,2,...,5: {1,2,3,4,5,1,2,3,4,1,5,2,3,1,4,2,3,5,1} The proof is shown here: {1,2,3,4,5,-,-,-,-,-,-,-,-,-,-,-,-,-,-} {1,2,3,-,5,-,-,-,4,-,-,-,-,-,-,-,-,-,-} {1,2,-,4,-,-,-,3,-,-,5,-,-,-,-,-,-,-,-} {1,2,-,4,5,-,-,3,-,-,-,-,-,-,-,-,-,-,-} {1,2,-,-,5,-,-,3,4,-,-,-,-,-,-,-,-,-,-} {1,2,-,-,5,-,-,-,4,-,-,-,3,-,-,-,-,-,-} {1,-,3,-,-,-,2,-,4,-,5,-,-,-,-,-,-,-,-} {1,-,3,-,-,-,2,-,-,-,5,-,-,-,4,-,-,-,-} {1,-,3,4,-,-,2,-,-,-,5,-,-,-,-,-,-,-,-} {1,-,3,4,5,-,2,-,-,-,-,-,-,-,-,-,-,-,-} {1,-,3,-,5,-,2,-,4,-,-,-,-,-,-,-,-,-,-} {1,-,3,-,5,-,-,-,4,-,-,2,-,-,-,-,-,-,-} {1,-,-,4,-,-,2,3,-,-,5,-,-,-,-,-,-,-,-} {1,-,-,4,-,-,2,-,-,-,5,-,3,-,-,-,-,-,-} {1,-,-,4,-,-,-,3,-,-,-,2,-,-,-,-,-,5,-} {1,-,-,4,-,-,-,3,-,-,5,2,-,-,-,-,-,-,-} {1,-,-,4,5,-,2,3,-,-,-,-,-,-,-,-,-,-,-} {1,-,-,4,5,-,-,3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return[x0], x0[[i]] = 1]]]; Join[{1}, Table[p = Permutations[Range[n], {n}]; For[tl = n + 1, tl <= 50, tl++, tup = ConstantArray[1, tl]; While[tup = NextTuple[tup, n, tl]; tup != {}, If[Product[Count[tup, i], {i, 1, n}] == 0, Continue[]]; For[j = 1, j <= Length[p], j++, perm = p[[j]]; lst = tup; fnd = True; For[k = 1, k <= Length[perm], k++, If[lst == {}, fnd = False; Break[]]; p1 = Position[lst, perm[[k]], 1, 1]; If[Length[p1] == 0, fnd = False; Break[]]; p1 = First@First@p1; If[! IntegerQ[p1], fnd = False; Break[]]; lst = Drop[lst, p1]; ]; If[! fnd, Break[]]]; If[fnd, Break[]]]; If[fnd, Break[]]]; tl, {n, 2, 5}]](* Robert Price, Oct 13 2019 *)
Comments