OFFSET
0,10
COMMENTS
a(n) is also the number of lattice points in a sequence of polytopes. Given n, define a vector x(k) = #{j : a_j = k} and define a matrix A with n columns as follows: first row all 1 (gives length of a_j); second row 1,2,...,n (sum of a_j); finally one row for each prime p <= n with entries A(row p, column k) = maximum exponent of p that divides k, e.g., A(p=2,k=8)=3 because 2^3|8 (this gives factorization of product of a_j). Then a(n) is the number of nonnegative integer lattice points in the polytope A*x = A*(1,1,1...)T. - Martin Fuller, Feb 12 2023
LINKS
Martin Fuller, Table of n, a(n) for n = 0..61
FORMULA
a(p) = a(p-1) for prime p. - Alois P. Heinz, Jul 05 2022
EXAMPLE
a(9) = 2 because the sequences (1, 2, 3, 4, 5, 6, 7, 8, 9) and (1, 2, 4, 4, 4, 5, 7, 9, 9) both add up to 45 and multiply up to 9!.
MATHEMATICA
a[n_] := a[n] = Module[{b}, b[c_, s_, p_, m_] := b[c, s, p, m] = Module[{x}, If[c <= 0 || m <= 1 || s <= c || s > m*c, Boole[ c == s && p == 1], x = IntegerExponent[p, m]; Sum[b[c - i, s - m*i, p/m^i, m - 1], {i, x*Boole@PrimeQ[m], x} ]]]; b[n, n*(n + 1)/2, n!, n]];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 32}] (* Jean-François Alcover, Jul 05 2022, after Martin Fuller *)
PROG
(PARI) a(n) = (b(c, s, p, m) = local(x); if(c<=0||m<=1||s<=c||s>m*c, c==s&&p==1, x=valuation(p, m); sum(i=x*isprime(m), x, b(c-i, s-m*i, p/m^i, m-1)))); b(n, n*(n+1)/2, n!, n) \\ Martin Fuller, Jun 26 2006
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Jens Voß, May 30 2006
EXTENSIONS
a(18) and a(19) from John W. Layman, Jun 08 2006
More terms from Martin Fuller, Jun 26 2006
a(0)=1 prepended by Alois P. Heinz, Jul 05 2022
a(36)-a(61) from Martin Fuller, Feb 12 2023
STATUS
approved