OFFSET
1,2
COMMENTS
FORMULA
T(n,k)=n^2-2k+2 if n>=k; T(n,k)=k^2-2n+1 if n<k.
EXAMPLE
Northwest corner:
1...3...8...15...24
4...2...6...13...22
9...7...5...11...20
16..14..12..10...18
MATHEMATICA
f[n_, k_]:=n^2-2*k+2/; n>=k;
f[n_, k_]:=k^2-2*n+1/; n<k;
TableForm[Table[f[n, k], {n, 1, 10}, {k, 1, 15}]]
Table[f[n-k+1, k], {n, 14}, {k, n, 1, -1}]//Flatten
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Feb 01 2011
STATUS
approved