OFFSET
1,3
COMMENTS
The transformation process starts with an upwards column of numbers 1..n.
The rightmost number of the topmost row slides right across columns 1 smaller (if any), and then drops down either onto a 2 or more smaller final column if there is one, or otherwise starting a new final column.
Sliding steps continue until reaching a single row (all columns height 1), which is triangle row n.
The final move is always with 2 that slides rightward then one step down to the end of the resulting single row. 1 never moves.
The resulting row is a self-inverse permutation (involution) because the reverse steps are exactly those performed if the row is stood up as the starting column again.
In the case of transforming the column of a composite n, there will be instances when a number sliding sideways will drop down just one step as the changing stack becomes a complete rectangle of rows and columns. Such a number is always greater by 1 than the height of the completed rectangle, whose height and width are divisors of n.
The travel of a sliding number, other than 2, that thus completes a rectangle will continue: it immediately moves sideways again one step, then downwards. Those n's that are prime numbers will not have such number since their changing stack can never form a rectangle with divisors greater than 1, except themselves.
When performing the process in an orthogonal grid where the numbers slide sideways and downward in discrete steps, the total steps for n is an oblong number, the sequence of which is A002378.
In the orthogonal grid, in mid-process, the bounding box of the changing stack of numbers follows the n = x*y curve, and is in exact contact with it at integer x and y points where n is composite.
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.
FORMULA
a(floor(((n+3)^2 - 2*n - 3)/2)) = 3, for n > 0. - Thomas Scheuerle, Mar 21 2023
EXAMPLE
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
PROG
(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
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Tamas Sandor Nagy, Mar 19 2023
STATUS
approved