OFFSET
1,2
COMMENTS
The first four columns (excluding the initial term of each) are A000217 (triangular numbers), A006527, A062026 and A062027. The first and third diagonals are both A000142 (factorials). The second diagonal is A000254.
Without the exception for k = n, a(n, n) would be n*n! (A001563(n)). For example, a(3, 3) would be 1*2*3 + 2*3*1 + 3*1*2 instead of 1*2*3. The author's original description did not mention the exception. I guess it didn't make sense to him to add n identical terms. - David Wasserman, Oct 01 2008
EXAMPLE
a(5, 3) = 1*2*3 + 2*3*4 + 3*4*5 + 4*5*1 + 5*1*2 = 120.
PROG
(PARI) f(x, y) = if (x > y, x - y, x);
a(n, k) = if (n == k, n!, sum (i = 0, n - 1, prod (j = i + 1, i + k, f(j, n)))); \\ David Wasserman, Oct 01 2008
CROSSREFS
KEYWORD
AUTHOR
Amarnath Murthy, Jul 10 2005
EXTENSIONS
Edited and extended by David Wasserman, Oct 01 2008
STATUS
approved