login
A328576
Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(0) = 0 and for n > 0, f(n) = [A276088(n), A328575(n)], for all i, j.
3
1, 2, 2, 2, 3, 4, 2, 2, 2, 2, 3, 4, 3, 5, 5, 5, 6, 7, 8, 9, 9, 9, 10, 11, 12, 13, 13, 13, 14, 15, 2, 2, 2, 2, 3, 4, 2, 2, 2, 2, 3, 4, 3, 5, 5, 5, 6, 7, 8, 9, 9, 9, 10, 11, 12, 13, 13, 13, 14, 15, 3, 16, 16, 16, 17, 18, 16, 16, 16, 16, 17, 18, 17, 19, 19, 19, 20, 21, 22, 23, 23, 23, 24, 25, 26, 27, 27, 27, 28, 29, 30, 31, 31, 31, 32, 33, 31, 31, 31, 31, 32, 33
OFFSET
0,2
COMMENTS
Restricted growth sequence transform of function f, defined as: f(0) = 0 and for n > 0, f(n) = [A276088(n), A328575(n)].
For all i, j: a(i) = a(j) => A328114(i) = A328114(j).
PROG
(PARI)
up_to = 32768;
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; };
A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); }; \\ From A003557
A032742(n) = if(1==n, n, n/vecmin(factor(n)[, 1]));
A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
A276088(n) = { my(e=0, p=2); while(n && !(e=(n%p)), n = n/p; p = nextprime(1+p)); (e); };
Aux328576(n) = if(!n, n, [A276088(n), A328575(n)]);
v328576 = rgs_transform(vector(1+up_to, n, Aux328576(n-1)));
A328576(n) = v328576[1+n];
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 20 2019
STATUS
approved