OFFSET
1,1
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1275
Eric Weisstein's World of Mathematics, Irredundant Set
Eric Weisstein's World of Mathematics, Rook Graph
FORMULA
EXAMPLE
Array begins:
===============================================================
m\n| 1 2 3 4 5 6 7 8
---+-----------------------------------------------------------
1 | 2 3 4 5 6 7 8 9 ...
2 | 3 11 24 47 88 163 304 575 ...
3 | 4 24 94 272 774 2230 6542 19452 ...
4 | 5 47 272 1185 4280 15781 60604 240073 ...
5 | 6 88 774 4280 20106 88512 400728 1879744 ...
6 | 7 163 2230 15781 88512 453271 2326534 12363513 ...
7 | 8 304 6542 60604 400728 2326534 13169346 76446456 ...
8 | 9 575 19452 240073 1879744 12363513 76446456 476777153 ...
...
MATHEMATICA
s[n_, k_]:=Sum[(-1)^i*Binomial[n, i] StirlingS2[n - i, k - i], {i, 0, Min[n, k]}];
c[m_, n_, x_]:=Sum[Binomial[m, i] (n^i - n!*StirlingS2[i, n])*x^i, {i, 0, m - 1}];
p[m_, n_, x_]:=Sum[Sum[Binomial[m, k] Binomial[n, r]* k!*s[r, k]*x^r*c[m - k, n - r, x], {r, 2k, n - 1}], {k, 0, m - 1}];
b[m_, n_, x_]:=m^n*x^n + n^m*x^m - If[n<=m, n!*x^m*StirlingS2[m, n], m!*x^n*StirlingS2[n, m]];
T[m_, n_]:= b[m, n, 1] + p[m, n, 1];
Table[T[n, m -n + 1], {m, 10}, {n, m}]//Flatten
(* Indranil Ghosh, Aug 12 2017, after PARI code *)
PROG
(PARI) \\ See A. Howroyd note in A290586 for explanation.
s(n, k)=sum(i=0, min(n, k), (-1)^i * binomial(n, i) * stirling(n-i, k-i, 2) );
c(m, n, x)=sum(i=0, m-1, binomial(m, i) * (n^i - n!*stirling(i, n, 2))*x^i);
p(m, n, x)={sum(k=0, m-1, sum(r=2*k, n-1, binomial(m, k) * binomial(n, r) * k! * s(r, k) * x^r * c(m-k, n-r, x) ))}
b(m, n, x) = m^n*x^n + n^m*x^m - if(n<=m, n!*x^m*stirling(m, n, 2), m!*x^n*stirling(n, m, 2));
T(m, n) = b(m, n, 1) + p(m, n, 1);
for(m=1, 10, for(n=1, m, print1(T(n, m-n+1), ", ")));
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Howroyd, Aug 11 2017
STATUS
approved