OFFSET
1,2
COMMENTS
LINKS
PROG
(PARI)
up_to = 32769;
rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om, invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om, invec[i], i); outvec[i] = u; u++ )); outvec; };
write_to_bfile(start_offset, vec, bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
A020639(n) = { if(1==n, n, vecmin(factor(n)[, 1])); };
A078898(n) = { if(n<=1, n, my(spf=A020639(n), k=1, m=n/spf); while(m>1, if(A020639(m)>=spf, k++); m--); (k)); };
A001511(n) = 1+valuation(n, 2);
A302044(n) = if(1==n, n, my(k=0); while((n%2), n = A268674(n); k++); n = (n/2^valuation(n, 2)); while(k>0, n = A250469(n); k--); (n));
Aux302046(n) = if(1==n, n, my(k=A302041(n), v = vector(k), i=1); while(n>1, v[i] = A302045(n); n = A302044(n); i++); vecsort(v));
write_to_bfile(1, rgs_transform(vector(up_to, n, Aux302046(n))), "b302046.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 31 2018
STATUS
approved