\\ A PARI-program to compute terms of A014649 quickly. This works at least in GP/PARI CALCULATOR Version 2.9.4 \\ To run the program, just say read("a014649.gp.txt") in PARI. \\ Based on David A. Corneth's PARI-program given at https://oeis.org/A066874/a066874.gp.txt \\ (But note that the routine customparts is different here!) \\ Antti Karttunen just provided the routine nonprimepower_divisors_with1 \\ \\ To produce a b-file, say: \\ \\ allocatemem(2^30); \\ default(parisizemax,2^31); \\ for(n=1,20000,write("b014649.txt", n, " ", A014649(n))); \\ A014649(n) = (customparts(nonprimepower_divisors_with1(n), n-1)[n]); nonprimepower_divisors_with1(n) = vecsort(select(d -> ((1==d) || !isprimepower(d)), divisors(n))); addhelp(customparts, "Vector of n+1 of number of partitions of 0 through n into parts of v. Assumes distinct elements in v.") customparts(v, n) = { my(res = vector(n+1)); res[1] = 1; for(i = 1, #v, for(j = v[i]+1, n+1, res[j] += res[j - v[i]] ) ); res } custompartsIterate(n) = { my(v = vector(n, i, 1), s = sum(i = 1, n, vpartsCopy[v[i]])); while(v != 0, j = 0; s = sum(i=1,#v,vpartsCopy[v[i]]); if(s < maxSum, mapisdefined(vInv, maxSum - s, &j); if(j >= v[#v], count++ ); v = nxtVl(v, #vpartsCopy); , v = nxtVs(v) ) ) } nxtVl(v, {u = oo}) = { if(v[#v] + 1 <= u, v[#v]++; v , nxtVs(v) ) } nxtVs(v) = { forstep(j = #v - 1, 1, -1, if(v[j] + 1 < v[#v], v[j]++; for(k = j + 1, #v, v[k] = v[j] ); return(v) ) ) ; return([0]) }