A361642 Triangle read by rows where row n is a self-inverse permutation of 1..n formed starting from a column 1..n and sliding numbers to the right and down.
1, 1, 2, 1, 3, 2, 1, 4, 3, 2, 1, 5, 3, 4, 2, 1, 6, 4, 3, 5, 2, 1, 7, 4, 3, 5, 6, 2, 1, 8, 5, 6, 3, 4, 7, 2, 1, 9, 5, 4, 3, 7, 6, 8, 2, 1, 10, 6, 4, 8, 3, 7, 5, 9, 2, 1, 11, 6, 8, 5, 3, 9, 4, 7, 10, 2, 1, 12, 7, 5, 4, 10, 3, 8, 9, 6, 11, 2, 1, 13, 7, 5, 4, 6, 3, 11, 10, 9, 8, 12, 2, 1, 14, 8, 10, 11, 6, 12, 3, 9, 4, 5, 7, 13, 2
Offset: 1
Examples
Triangle T(n,k) begins: n/k | 1 2 3 4 5 6 7 ---------------------------- 1 | 1; 2 | 1, 2; 3 | 1, 3, 2; 4 | 1, 4, 3, 2; 5 | 1, 5, 3, 4, 2; 6 | 1, 6, 4, 3, 5, 2; 7 | 1, 7, 4, 3, 5, 6, 2; ... . A few snapshots of the process for n = 7, a prime number: . 7 6 5 4 4 3 3 5 3 5 3 2 2 6 2 6 2 6 5 2 6 5 1 1 7 1 7 4 1 7 4 1 7 4 3 1 7 4 3 5 6 2 . An example showing some stages of the process for a composite n = 6, with completed rectangles: . 6 5 4 3 3 4 2 2 5 2 5 3 1 1 6 1 6 4 1 6 4 3 5 2 . Step-by-step animation frames, showing 8, the rightmost number of the top row, sliding and dropping during its second movement, in the operation for n = 11: . 4 8 4 8 4 8 4 4 4 3 9 5 3 9 5 3 9 5 3 9 5 8 3 9 5 3 9 5 2 10 7 2 10 7 2 10 7 2 10 7 2 10 7 8 2 10 7 1 11 6 1 11 6 1 11 6 1 11 6 1 11 6 1 11 6 8
Links
- Thomas Scheuerle, Numbers colored by absolute displacement. Horizontally: row n of the triangle T(n, k). Vertically: k.
- Thomas Scheuerle, Numbers colored by value. Horizontally: row n of the triangle T(n, k). Vertically: k.
Programs
-
MATLAB
function a = A361642( max_row ) a = 1; for r = 2:max_row p = [1:r]; for k = 2:r-1 j = [1:r]; t1 = find(mod(j,k) == 0); t2 = find(mod(j,k) ~= 0); j(t1) = [r:-1:r-length(t1)+1]; j(t2) = [1:length(t2)]; p = p(j); end a = [a p]; end end % Thomas Scheuerle, Mar 21 2023
Formula
a(floor(((n+3)^2 - 2*n - 3)/2)) = 3, for n > 0. - Thomas Scheuerle, Mar 21 2023
Comments