login
Number of ordered finite sequences a_1 <= a_2 <= ... <= a_n of length n of positive integers less than or equal to n whose product is n!.
1

%I #14 Jul 05 2022 16:30:08

%S 1,1,1,1,2,2,6,6,13,33,97,97,306,306,896,2804,7974,7974,24929,24929,

%T 82612,263913,782310,782310,2692708,7705973,22901921,69066986,

%U 232517327,232517327,853599455,853599455,2737549933,8929178758,26621287019,90741181490,325528535021,325528535021

%N Number of ordered finite sequences a_1 <= a_2 <= ... <= a_n of length n of positive integers less than or equal to n whose product is n!.

%F a(p) = a(p-1) for prime p. - _Alois P. Heinz_, Jul 05 2022

%e a(5) = 2 because 5! = 1*2*3*4*5 = 2*2*2*3*5.

%t a[n_] := a[n] = Module[{b}, b[c_, p_, m_] := b[c, p, m] = Module[{x}, If[c <= 0 || m <= 1 || p > m^c, Boole[p == 1], x = IntegerExponent[p, m]; Sum[b[c - i, p/m^i, m - 1], {i, x*Boole@PrimeQ[m], x}]]]; b[n, n!, n]];

%t Table[Print[n, " ", a[n]]; a[n], {n, 0, 37}] (* _Jean-François Alcover_, Jul 05 2022, after _Martin Fuller_ *)

%o (PARI) a(n) = (b(c,p,m) = local(x); if(c<=0||m<=1||p>m^c, p==1, x=valuation(p,m); sum(i=x*isprime(m), x, b(c-i,p/m^i,m-1)))); b(n,n!,n)

%Y Cf. A000040, A119551.

%K nonn

%O 0,5

%A _Martin Fuller_, Jun 26 2006

%E a(0)=1 prepended and a(24)-a(37) added by _Alois P. Heinz_, Jul 05 2022