\\Computes a(n) and if you uncomment the printstatements, prints the products for which the result \\occurs just once. Works for n < 9 for me due to memory restrictions. a(n) = {my(r=vector(binomial(2*n-1,n-1)),p,t,q); forvec(v=vector(n,i,[1,n]), q++;p=prod(i=1,#v,v[i]); r[q]=[p,v] , 1 );r=vecsort(r); \\If you want to see the vector resulting in this unique product, uncomment the following statement: \\print(r[1]); \\If you want to see the vector resulting in this unique product, \\and the frequency of each factor, uncomment the following statement: \\print(r[1]" "freq(r[1][2])); for(i=2,#r-1, if(r[i-1][1]!=r[i][1]&&r[i][1]!=r[i+1][1], t++; \\If you want to see the vector resulting in this unique product, uncomment the following statement: \\print(r[i]); \\If you want to see the vector resulting in this unique product, \\and the frequency of each factor, uncomment the following statement: \\print(r[i]" "freq(r[i][2])); ) ); if(n>1, \\If you want to see the vector resulting in this unique product, uncomment the following statement: \\print(r[#r]); \\If you want to see the vector resulting in this unique product, \\and the frequency of each factor, uncomment the following statement: print(r[#r]" "freq(r[#r][2])); t+2 , t+1 ) } \\ function returns a vector r that tells how often an element i occurs in a vector v, 1 <= i <= #r. freq(v) = {my(r = vector(#v)); for(i=1,#v,r[v[i]]++);r }