login
A297157
Restricted growth sequence transform of A297156, which is Möbius transform of A243354.
5
1, 2, 3, 2, 4, 5, 6, 3, 2, 7, 8, 7, 9, 10, 5, 11, 12, 5, 13, 10, 14, 15, 16, 14, 2, 17, 4, 15, 18, 19, 20, 21, 22, 23, 5, 5, 24, 25, 26, 22, 27, 28, 29, 17, 10, 30, 31, 32, 2, 5, 33, 23, 34, 7, 35, 26, 36, 37, 38, 19, 39, 40, 15, 41, 42, 43, 44, 25, 45, 19, 46, 7, 47, 48, 7, 30, 5, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 33
OFFSET
1,2
LINKS
PROG
(PARI)
up_to = 8192;
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])); }
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ Essentially Joerg Arndt's Jul 19 2012 code.
A297156(n) = sumdiv(n, d, moebius(n/d)*A243354(d));
write_to_bfile(1, rgs_transform(vector(up_to, n, A297156(n))), "b297157.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 28 2017
STATUS
approved