login
A373988
Lexicographically earliest infinite sequence such that a(i) = a(j) => A373986(i) = A373986(j), for all i, j >= 1.
2
1, 2, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 2, 2, 8, 2, 9, 10, 11, 2, 2, 2, 12, 2, 13, 2, 14, 2, 6, 15, 16, 17, 2, 2, 18, 19, 4, 2, 20, 2, 21, 8, 22, 2, 8, 2, 23, 24, 25, 2, 6, 26, 27, 28, 29, 2, 2, 2, 30, 31, 4, 32, 33, 2, 34, 35, 36, 2, 2, 2, 37, 38, 39, 3, 40, 2, 14, 2, 41, 2, 38, 42, 43, 44, 15, 2, 38, 45, 46, 47, 48, 49, 2, 2, 50, 51, 17, 2, 52, 2, 19
OFFSET
1,2
COMMENTS
Restricted growth sequence transform of A373986.
For all i, j >= 1: A305800(i) = A305800(j) => a(i) = a(j).
PROG
(PARI)
up_to = 100000;
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; };
A373986(n) = { my(f=factor(n), m=1, s=0); for(i=1, #f~, my(x=prod(i=1, primepi(f[i, 1]), prime(i))); s += f[i, 2]*x; m *= x^f[i, 2]); s/gcd(m, s); };
v373988 = rgs_transform(vector(up_to, n, A373986(n)));
A373988(n) = v373988[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 25 2024
STATUS
approved