login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of compositions of n^2, such that each element of [n] is used at least once as a part.
4

%I #23 Sep 08 2021 11:13:04

%S 1,1,3,72,6232,1621620,1241237520,2675188471920,15634073104902000,

%T 239929277724680059440,9411787539302194544158080,

%U 922671287397731617736789070720,221805878984619105095368813189002240,128660270226206951104782827202740054476800

%N Number of compositions of n^2, such that each element of [n] is used at least once as a part.

%C Some parts can be larger than n. Adding the condition that parts cannot be larger than n, we get A332721. Removing from A332721 the condition that each element of [n] has to be used, we get A332716.

%H Alois P. Heinz, <a href="/A332747/b332747.txt">Table of n, a(n) for n = 0..50</a>

%e a(4) = 6232: all permutations of 4321111111, 432211111, 43222111, 4322221, 43321111, 4332211, 433321, 4432111, 443221, 543211, 64321.

%p b:= proc(n, i, p, m) option remember; `if`(n=0, p!,

%p `if`(i<1, 0, (t-> add(b(n-i*j, i-1, p+j, t)/(j+

%p `if`(t=0, 1, 0))!, j=0..n/i))(`if`(i>m, m, 0))))

%p end:

%p a:= n-> b(n*(n-1)/2$2, n$2):

%p seq(a(n), n=0..15);

%t b[n_, i_, p_, m_] := b[n, i, p, m] = If[n == 0, p!,

%t If[i < 1, 0, Function[t, [b[n - i*j, i - 1, p + j, t]/(j +

%t If[t == 0, 1, 0])!, {j, 0, n/i}]][If[i > m, m, 0]]]];

%t a[n_] := b[n(n-1)/2, n(n-1)/2, n, n];

%t Table[a[n], {n, 0, 15}] (* _Jean-François Alcover_, Sep 08 2021, after _Alois P. Heinz_ *)

%Y Cf. A011782, A103488, A332716, A332721, A332796.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Feb 21 2020