A120690 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, 1, 1, 1, 2, 2, 6, 6, 13, 33, 97, 97, 306, 306, 896, 2804, 7974, 7974, 24929, 24929, 82612, 263913, 782310, 782310, 2692708, 7705973, 22901921, 69066986, 232517327, 232517327, 853599455, 853599455, 2737549933, 8929178758, 26621287019, 90741181490, 325528535021, 325528535021
Offset: 0
Keywords
Examples
a(5) = 2 because 5! = 1*2*3*4*5 = 2*2*2*3*5.
Programs
-
Mathematica
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]]; Table[Print[n, " ", a[n]]; a[n], {n, 0, 37}] (* Jean-François Alcover, Jul 05 2022, after Martin Fuller *)
-
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)
Formula
a(p) = a(p-1) for prime p. - Alois P. Heinz, Jul 05 2022
Extensions
a(0)=1 prepended and a(24)-a(37) added by Alois P. Heinz, Jul 05 2022