OFFSET
1,5
COMMENTS
To compute T(n,k), start from k^n, then subtract (progressively strictly) smaller n-th powers whenever possible.
Since we subtract the smaller n-th powers in a greedy way, T(n,k) may be nonzero even if k^n is a sum of smaller n-th powers: cf. rows of A332065 for these k.
FORMULA
EXAMPLE
The square array starts
n\k: 1 2 3 4 5 6 7 8 9 10 11 12 13
--+----------------------------------------------------------------------------
1 | 1 1 0 0 0 0 0 0 0 0 0 0 0
2 | 1 3 4 2 0 1 0 1 0 2 0 2 0
3 | 1 7 18 28 25 0 1 8 0 19 15 18 0
4 | 1 15 64 158 271 317 126 45 47 59 191 61 285
5 | 1 31 210 748 1825 3351 4606 3760 398 131 702 0 1229
6 | 1 63 664 3302 10735 26141 50478 77324 84477 21595 55300 29603 2093
(...)
We have T(2,10) = 10^2 - 9^2 - 4^2 - 1 = 2, because we first have to subtract 9^2 = 81, even though 10 is in row 2 of A332065 since 10^2 - 8^2 - 6^2 = 0.
PROG
(PARI) A332099(n, k, t=k^n)={while(k&&t, t-=(k=min(sqrtnint(t, n), k-1))^n); t}
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
M. F. Hasler, Apr 19 2020
STATUS
approved