login

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

Number of compositions of n^2 with parts <= n, such that each element of [n] is used at least once.
6

%I #32 May 26 2024 12:20:59

%S 1,1,3,72,5752,1501620,1171326960,2571831080160,15245263511750160,

%T 236246829658682027760,9325247205993698149853760,

%U 917699267902161951609308035200,221117091698491444413008381486903040,128433050637127079872089064922773889126400

%N Number of compositions of n^2 with parts <= n, such that each element of [n] is used at least once.

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

%F a(n) = A373118(n^2,n). - _Alois P. Heinz_, May 26 2024

%e a(2) = 3: 112, 121, 211.

%e a(3) = 72: 111123, 111132, 111213, 111231, 111312, 111321, 112113, 112131, 112311, 113112, 113121, 113211, 121113, 121131, 121311, 123111, 131112, 131121, 131211, 132111, 211113, 211131, 211311, 213111, 231111, 311112, 311121, 311211, 312111, 321111, 11223, 11232, 11322, 12123, 12132, 12213, 12231, 12312, 12321, 13122, 13212, 13221, 21123, 21132, 21213, 21231, 21312, 21321, 22113, 22131, 22311, 23112, 23121, 23211, 31122, 31212, 31221, 32112, 32121, 32211, 1233, 1323, 1332, 2133, 2313, 2331, 3123, 3132, 3213, 3231, 3312, 3321.

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

%p /(n+1)!, add(b(n-i*j, i-1, p+j)/(j+1)!, j=0..n/i))

%p end:

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

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

%t b[n_, i_, p_] := b[n, i, p] = If[n == 0 || i == 1, (p + n)!/(n + 1)!, Sum[b[n - i*j, i - 1, p + j]/(j + 1)!, {j, 0, n/i}]];

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

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

%Y Cf. A000079, A000290, A103488, A332716, A332747, A332796, A373118.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Feb 21 2020