A385866 Triangle read by rows where T(n,k), for 1 <= k < n, is the row number where (n-k)^2 occurs in an n X n grid filled rowwise with the numbers 1 to n^2.
1, 2, 1, 3, 1, 1, 4, 2, 1, 1, 5, 3, 2, 1, 1, 6, 4, 3, 2, 1, 1, 7, 5, 4, 2, 2, 1, 1, 8, 6, 4, 3, 2, 1, 1, 1, 9, 7, 5, 4, 3, 2, 1, 1, 1, 10, 8, 6, 5, 4, 3, 2, 1, 1, 1, 11, 9, 7, 6, 5, 3, 3, 2, 1, 1, 1, 12, 10, 8, 7, 5, 4, 3, 2, 2, 1, 1, 1, 13, 11, 9, 8, 6, 5, 4, 3, 2, 2, 1, 1, 1
Offset: 2
Examples
k=1 2 3 4 5 6 n=2: 1 n=3: 2, 1 n=4: 3, 1, 1 n=5: 4, 2, 1, 1 n=6: 5, 3, 2, 1, 1 n=7: 6, 4, 2, 2, 1, 1 For n = 5, the grid is: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 The squares (n-k)^2 = {16, 9, 4, 1} are in row numbers {4, 2, 1, 1} respectively.
Crossrefs
Cf. A385865 (column position).
Programs
-
Mathematica
T[n_,k_]:=Floor[((n-k)^2-1)/n]+1;Table[T[n,k],{n,14},{k,n-1}]//Flatten (* James C. McMahon, Jul 17 2025 *)
Formula
T(n, k) = floor(((n-k)^2 - 1) / n) + 1.
Comments