A220417 Table T(n,k) = k^n - n^k, n, k > 0, read by descending antidiagonals.
0, 1, -1, 2, 0, -2, 3, 1, -1, -3, 4, 0, 0, 0, -4, 5, -7, -17, 17, 7, -5, 6, -28, -118, 0, 118, 28, -6, 7, -79, -513, -399, 399, 513, 79, -7, 8, -192, -1844, -2800, 0, 2800, 1844, 192, -8, 9, -431, -6049, -13983, -7849, 7849, 13983, 6049, 431, -9, 10, -924, -18954, -61440, -61318, 0, 61318, 61440, 18954, 924, -10
Offset: 1
Examples
The table T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows: 0 1 2 3 4 5 ... -1 0 1 0 -7 -28 ... -2 -1 0 -17 -118 -513 ... -3 0 17 0 -399 -2800 ... -4 7 118 399 0 -7849 ... -5 28 513 2800 7849 0 ... ... The start of the sequence as a triangular array, read by rows (i.e., descending antidiagonals of T(n,k)), is as follows: 0; 1, -1; 2, 0, -2; 3, 1, -1, -3; 4, 0, 0, 0, -4; 5, -7, -17, 17, 7, -5; 6, -28, -118, 0, 118, 28, -6; ... In the above triangle, row number m contains m numbers: m^1 - 1^m, (m-1)^2 - 2^(m-1), ..., 1^m - m^1.
Links
- Boris Putievskiy, Rows n = 1..76 of triangle, flattened
Programs
-
PARI
matrix(9, 9, n, k, k^n - n^k) \\ Michel Marcus, Oct 04 2019
-
Python
t=int((math.sqrt(8*n-7) - 1)/ 2) m=((t*t+3*t+4)/2-n)**(n-t*(t+1)/2)-(n-t*(t+1)/2)**((t*t+3*t+4)/2-n)