login
A(n,k) is the n-th number that is a sum of k positive k-th powers; square array A(n,k), n>=1, k>=1, read by antidiagonals.
10

%I #19 Dec 03 2020 11:49:58

%S 1,2,2,3,5,3,4,10,8,4,5,19,17,10,5,6,36,34,24,13,6,7,69,67,49,29,17,7,

%T 8,134,132,98,64,36,18,8,9,263,261,195,129,84,43,20,9,10,520,518,388,

%U 258,160,99,55,25,10,11,1033,1031,773,515,321,247,114,62,26,11,12,2058,2056,1542,1028,642,384,278,129,66,29,12

%N A(n,k) is the n-th number that is a sum of k positive k-th powers; square array A(n,k), n>=1, k>=1, read by antidiagonals.

%H Alois P. Heinz, <a href="/A336725/b336725.txt">Antidiagonals n = 1..141, flattened</a>

%e Square array A(n,k) begins:

%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...

%e 2, 5, 10, 19, 36, 69, 134, 263, 520, 1033, ...

%e 3, 8, 17, 34, 67, 132, 261, 518, 1031, 2056, ...

%e 4, 10, 24, 49, 98, 195, 388, 773, 1542, 3079, ...

%e 5, 13, 29, 64, 129, 258, 515, 1028, 2053, 4102, ...

%e 6, 17, 36, 84, 160, 321, 642, 1283, 2564, 5125, ...

%e 7, 18, 43, 99, 247, 384, 769, 1538, 3075, 6148, ...

%e 8, 20, 55, 114, 278, 734, 896, 1793, 3586, 7171, ...

%e 9, 25, 62, 129, 309, 797, 2193, 2048, 4097, 8194, ...

%e 10, 26, 66, 164, 340, 860, 2320, 6568, 4608, 9217, ...

%p A:= proc() local l, w, A; l, w, A:= proc() [] end, proc() [] end,

%p proc(n, k) option remember; local b; b:=

%p proc(x, y) option remember; `if`(x=0, {0}, `if`(y<1, {},

%p {b(x, y-1)[], map(t-> t+l(k)[y], b(x-1, y))[]}))

%p end;

%p while nops(w(k)) < n do forget(b);

%p l(k):= [l(k)[], (nops(l(k))+1)^k];

%p w(k):= sort([select(h-> h<l(k)[-1], b(k, nops(l(k))))[]])

%p od; w(k)[n]

%p end; A

%p end():

%p seq(seq(A(n, 1+d-n), n=1..d), d=1..12);

%t nmax = 12;

%t pow[n_, k_] := IntegerPartitions[n, {k}, Range[n^(1/k) // Ceiling]^k];

%t col[k_] := col[k] = Reap[Module[{j = k, n = 1, p}, While[n <= nmax, p = pow[j, k]; If[p =!= {}, Sow[j]; n++]; j++]]][[2, 1]];

%t A[n_, k_] := col[k][[n]];

%t Table[A[n-k+1, k], {n, 1, nmax}, {k, n, 1, -1}] // Flatten (* _Jean-François Alcover_, Dec 03 2020 *)

%Y Columns k=1-11 give: A000027, A000404, A003072, A003338, A003350, A003362, A003374, A003386, A003398, A004810, A004822.

%Y Rows n=1-3 give: A000027, A052944, A145071.

%Y Main diagonal gives A000337.

%Y Cf. A336820.

%K nonn,tabl

%O 1,2

%A _Alois P. Heinz_, Aug 01 2020