OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65539
PROG
(PARI)
up_to = 65539;
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; };
ispow2(n) = (n && !bitand(n, n-1));
A302777(n) = ispow2(isprimepower(n));
A050376list(up_to) = { my(v=vector(up_to), i=0); for(n=1, oo, if(A302777(n), i++; v[i] = n); if(i == up_to, return(v))); };
v050376 = A050376list(up_to);
A050376(n) = v050376[n];
A052331(n) = { my(s=0, e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&A302777(n/d), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };
A323074aux(n) = if(isprime(n), -(n%4), A300840(n));
v323074 = rgs_transform(vector(up_to, n, A323074aux(n)));
A323074(n) = v323074[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 04 2019
STATUS
approved