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.

A351468 Irregular triangle read by rows where row n is Newey's sequence containing all permutations of 1..n.

This page as a plain text file.
%I A351468 #14 Mar 07 2022 06:31:11
%S A351468 1,2,1,2,1,2,3,1,2,1,3,1,2,3,4,1,2,3,1,4,2,1,3,1,2,3,4,5,1,2,3,4,1,5,
%T A351468 2,3,1,4,5,2,1,3,1,2,3,4,5,6,1,2,3,4,5,1,6,2,3,4,1,5,6,2,3,1,4,5,6,2,
%U A351468 1,3
%N A351468 Irregular triangle read by rows where row n is Newey's sequence containing all permutations of 1..n.
%C A351468 Row n contains n^2 - 2*n + 4 = A117950(n-1) terms, numbered as columns k >= 1. Row n contains within it all permutations of 1..n as subsequences. These subsequences need not be consecutive terms (and in general are not).
%C A351468 Newey's construction (section 6) is an initial 1..n then successive term 1 and n-2 terms from a rotating block of 2..n. The effect is term 1 at k=1, k=n+1, then steps n-1 apart, and the rest filled with repeating 2..n.
%C A351468 Koutas and Hu (equation (1)) form the same by blocks D_k(m|n) which start with 1 and then appropriate parts of rotated 2..n like Newey.
%C A351468 _Jon E. Schoenfield_ in A062714 starts from repeated 2..n and inserts 1's.
%C A351468 For n = 3 to 7, Newey shows these sequences are as short as possible (A062714) for any sequence containing all permutations, and noted the "obvious" conjecture that maybe they would be shortest always. But this is not so, since _Jon E. Schoenfield_ gives a shorter n=16 in A062714, and Radomirovic constructs shorter for all n >= 10.
%H A351468 Kevin Ryde, <a href="/A351468/b351468.txt">Table of n, a(n) for rows 2 .. 30, flattened</a>
%H A351468 P. J. Koutas and T. C. Hu, <a href="http://doi.org/10.1016/0012-365X(75)90004-7">Shortest String Containing All Permutations</a>, Discrete Mathematics, volume 11, 1975, pages 125-132.
%H A351468 Malcolm Newey, <a href="http://i.stanford.edu/TR/CS-TR-73-340.html">Notes on a Problem Involving Permutations as Subsequences</a>, Stanford Artificial Intelligence Laboratory, Memo AIM-190, STAN-CS-73-340, 1973.
%F A351468 T(n,k) = k for 1 <= k <= n, otherwise.
%F A351468 T(n,k) = 1 if r=0 and q<n, otherwise.
%F A351468 T(n,k) = 2 + ((r-q) mod (n-1)),
%F A351468 where division q = floor((k-2)/(n-1)) remainder r = (k-2) mod (n-1). [Adapted from _Jon E. Schoenfield_ in A062714.]
%e A351468 Triangle begins
%e A351468   n=2:  1,2,1,2
%e A351468   n=3:  1,2,3,1,2,1,3
%e A351468   n=4:  1,2,3,4,1,2,3,1,4,2,1,3
%e A351468   n=5:  1,2,3,4,5,1,2,3,4,1,5,2,3,1,4,5,2,1,3
%e A351468 For row n=3, the permutations of 1,2,3 are located within the row as follows (some are present in multiple ways too).
%e A351468    1,2,3,1,2,1,3     row n=3
%e A351468    1-2-3             \
%e A351468    1---3---2         | all permutations
%e A351468            2-1-3     | of 1,2,3 within
%e A351468      2-3-1           | row n=3
%e A351468        3-1-2         |
%e A351468        3---2-1       /
%e A351468 For row n=4, see example in A062714.
%e A351468 For row n=5, the pattern of 1's among repeating 2..5 is
%e A351468     2,3,4,5,  2,3,4,  5,2,3,  4,5,2,  3
%e A351468   1,        1,      1,      1,      1,
%e A351468    \-------/ \-----/ \-----/ \-----/
%e A351468     5 apart,   thereafter 4 apart
%o A351468 (PARI) T(n,k) = if(k<=n,k, my(q,r);[q,r]=divrem(k-2,n-1); if(r==0&&q<n,1, 2+(r-q)%(n-1)));
%o A351468 (PARI) row(n) = my(r=1,t=1); vector((n-1)^2+3,i, if(i==1,1, r++>n,r=1+(n>2);1, if(t++>n,t=2, t)));
%Y A351468 Cf. A117950 (row lengths), A062714 (shortest possible).
%Y A351468 Cf. A351469 (Adelman's sequences).
%K A351468 nonn,easy,tabf
%O A351468 2,2
%A A351468 _Kevin Ryde_, Feb 23 2022