%I #29 Mar 16 2019 17:43:23
%S 3,4,8,2,11,15,3,11,20,24,1,10,22,31,35,0,4,23,35,44,48,0,4,19,38,50,
%T 59,63,1,3,15,36,55,67,76,80,1,2,6,34,55,74,86,95,99,0,2,4,27,55,76,
%U 95,107,116,120,0,1,3,19,50,78,99,118,130,139,143,1,0,3,8,44,75,103,124,143,155,164,168
%N Regular triangle read by rows where T(n,k) is obtained by partitioning the set of the first n squares into k groups, then summing up each group and taking the minimum width, where the width is the difference between its greatest and its smallest term.
%C Collatz proves that for a sufficiently large n (depending on k), the k-th column is periodic with period 2*k^2, but remarks that column 2 and 3 appear to have periods 4 and 9, so he asks if the period is actually k^2.
%H L. Collatz, <a href="https://doi.org/10.1016/0012-365X(82)90226-6">Equipartition with square numbers</a>, Discrete Mathematics, Volume 42, Issues 2-3, 1982, pp. 313-316.
%F T(n,n) = n^2 - 1.
%e For n=3 and k=2, the partitions are (1,4; 9) or (1; 4,9) or (1,9; 4);
%e the sums are (5,9) or (1,13) or (4,10);
%e the widths are 4, 12, 6; so a(3,2) = 4, the minimum.
%e The triangle begins:
%e 3;
%e 4, 8;
%e 2, 11, 15;
%e 3, 11, 20, 24;
%e 1, 10, 22, 31, 35;
%e 0, 4, 23, 35, 44, 48;
%e 0, 4, 19, 38, 50, 59, 63;
%e 1, 3, 15, 36, 55, 67, 76, 80;
%e ...
%o (PARI) vj(j, b, n, p) = {vd = select(x->(x==j), b, 1); sum(k=1, #vd, vd[k]^2);}
%o a(n, p) = {my(res = sum(k=1, n, k^2), b, vone); for (k=0, p^n-1, b = digits(k, p); if (#b < n, b = concat(vector(n-#b), b)); if (#Set(b) == p, vone = vector(p, j, vj(j-1, b, n, p)); res = min(res, vecmax(vone) - vecmin(vone)););); res;}
%o tabl(nn) = for (n=2, nn, for (p=2, n, print1(a(n, p), ", ")); print); \\ _Michel Marcus_, Feb 24 2019
%Y Cf. A000110, A000290 (the squares), A005563, A133872.
%K nonn,tabl
%O 2,1
%A _Michel Marcus_, Feb 24 2019
%E 42 terms more (rows 10-13) from _Alois P. Heinz_, Mar 16 2019