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.

A355792 Triangular array, read by rows. The rules of the construction are described in the Comments section.

This page as a plain text file.
%I A355792 #37 Sep 26 2022 20:43:05
%S A355792 1,1,2,2,3,1,1,2,4,3,3,1,2,4,5,5,6,3,1,2,4,4,5,6,3,1,7,2,2,4,5,8,6,3,
%T A355792 1,7,7,2,4,5,8,6,3,1,9,9,10,7,2,4,5,8,6,3,1,1,9,11,10,7,2,4,5,8,6,3,3,
%U A355792 1,9,11,12,10,7,2,4,5,8,6,6,3,1,9,11,12,10,13,7,2
%N A355792 Triangular array, read by rows. The rules of the construction are described in the Comments section.
%C A355792 Row m contains m distinct elements of the set {1..m}. The last element k(m) in row m becomes the first one in row m+1. There, the remaining elements of row m repeat in the same order, with element m+1 inserted immediately after that which is the k(m)-th in row m.
%F A355792 From _Jon E. Schoenfield_, Jul 17 2022: (Start)
%F A355792 T(1, 1) = 1.
%F A355792 For n > 1, let j = 2 + (T(n-1, n-1) mod (n-1)); then
%F A355792    T(n, k) = T(n-1, n-1) if k = 1
%F A355792            = T(n-1, k-1) if 1 < k < j
%F A355792            = n           if k = j
%F A355792            = T(n-1, k-2) otherwise. (End)
%F A355792 Let b(n) = max(a(1),a(2),...,a(n)) then -(1/2) < 2^(1/2)*n^(1/2)-b(n) < (1/2). - _Thomas Scheuerle_, Jul 18 2022
%e A355792 Triangle begins
%e A355792   1;
%e A355792   1,  2;
%e A355792   2,  3,  1;
%e A355792   1,  2,  4,  3;
%e A355792   3,  1,  2,  4,  5;
%e A355792   5,  6,  3,  1,  2,  4;
%e A355792   4,  5,  6,  3,  1,  7,  2;
%e A355792   2,  4,  5,  8,  6,  3,  1,  7;
%e A355792   7,  2,  4,  5,  8,  6,  3,  1,  9;
%e A355792   9, 10,  7,  2,  4,  5,  8,  6,  3,  1;
%e A355792   1,  9, 11, 10,  7,  2,  4,  5,  8,  6,  3;
%e A355792   3,  1,  9, 11, 12, 10,  7,  2,  4,  5,  8,  6;
%e A355792   6,  3,  1,  9, 11, 12, 10, 13,  7,  2,  4,  5,  8;
%e A355792   ...
%e A355792 To illustrate the rule:
%e A355792 Row 6 ends with 4, therefore the next row, row 7, begins with 4.
%e A355792 The order of the rest of the elements in row 6, that is, 5, 6, 3, 1, and 2, remains unchanged in row 7, while there the new element 7 is introduced immediately after 1 since the 4th element in row 6 is 1.
%e A355792 From _Jon E. Schoenfield_, Jul 17 2022: (Start)
%e A355792 The diagram below illustrates the way in which, on each row, each number from the previous row is placed either to the left or the right of the new number (which is identified by parentheses):
%e A355792 .
%e A355792                                              (1)
%e A355792 .
%e A355792                                             1  (2)
%e A355792                                              \
%e A355792                                       2  (3)  1
%e A355792                                      /     \
%e A355792                                 1   2  (4)  3
%e A355792                                /   /   /
%e A355792                           3   1   2   4  (5)
%e A355792                            \   \   \   \
%e A355792                     5  (6)  3   1   2   4
%e A355792                    /   /   /   /     \
%e A355792               4   5   6   3   1  (7)  2
%e A355792              /   /     \   \   \   \
%e A355792         2   4   5  (8)  6   3   1   7
%e A355792        /   /   /   /   /   /   /
%e A355792   7   2   4   5   8   6   3   1  (9)
%e A355792 (End)
%o A355792 (MATLAB)
%o A355792 function a = A355792( max_row )
%o A355792     T = cell(1,1); T{1} = 1;
%o A355792     for n = 2:max_row
%o A355792         j = mod(T{n-1}(end),n-1);
%o A355792         s = circshift(T{n-1},1,2);
%o A355792         T{n} = [s(1:j+1) n s(j+2:end)];
%o A355792     end
%o A355792     a = [T{1:end}];
%o A355792 end % _Thomas Scheuerle_, Jul 18 2022
%Y A355792 Cf. A002260, A220073.
%K A355792 nonn,tabl
%O A355792 1,3
%A A355792 _Tamas Sandor Nagy_, Jul 17 2022