login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of ways to factor n into 2 kinds of 2, 3 kinds of 3, ...
33

%I #17 Jul 04 2018 20:21:25

%S 1,2,3,7,5,12,7,20,15,20,11,45,13,28,30,59,17,66,19,75,42,44,23,150,

%T 40,52,64,105,29,150,31,162,66,68,70,270,37,76,78,250,41,210,43,165,

%U 165,92,47,477,77,180,102,195,53,326,110,350,114,116,59,630,61,124,231

%N Number of ways to factor n into 2 kinds of 2, 3 kinds of 3, ...

%H N. J. A. Sloane, <a href="/A050367/b050367.txt">Table of n, a(n) for n = 1..1000</a>

%F Dirichlet g.f.: Product_{n>=2} 1/(1-1/n^s)^n.

%o (PARI, modeled on _Michael Somos_'s program for A007896, from _N. J. A. Sloane_, May 26 2014)

%o {a(n) = my(A, v, w, m);

%o if(

%o n<1, 0,

%o \\ define unit vector v = [1, 0, 0, ...] of length n

%o v = vector(n, k, k==1);

%o for(k=2, n,

%o m = #digits(n, k) - 1;

%o \\ expand 1/(1-x)^k out far enough

%o A = (1 - x)^ -k + x * O(x^m);

%o \\ w = zero vector of length n

%o w = vector(n);

%o \\ convert A to a vector

%o for(i=0, m, w[k^i] = polcoeff(A, i));

%o \\ build the answer

%o v = dirmul(v, w)

%o );

%o v[n]

%o )

%o };

%o \\ produce the sequence

%o vector(100,n,a(n))

%K nonn

%O 1,2

%A _Christian G. Bower_, Oct 15 1999