login
A324292
Lexicographically earliest sequence such that a(i) = a(j) => A324291(i) = A324291(j) for all i, j >= 1.
2
1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 4, 2, 2, 3, 2, 5, 4, 3, 2, 3, 2, 3, 2, 5, 2, 6, 2, 2, 4, 3, 7, 3, 2, 3, 4, 5, 2, 8, 2, 5, 9, 3, 2, 3, 2, 3, 4, 5, 2, 3, 7, 3, 4, 3, 2, 10, 2, 3, 4, 2, 11, 8, 2, 5, 4, 10, 2, 3, 2, 3, 4, 5, 12, 8, 2, 5, 2, 3, 2, 8, 11, 3, 4, 13, 2, 6, 14, 5, 4, 3, 7, 3, 2, 3, 15, 5, 2, 8, 2, 13, 16
OFFSET
1,2
COMMENTS
Restricted growth sequence transform of A324291.
For all i, j:
a(i) = a(j) => A001221(i) = A001221(j),
a(i) = a(j) => A324290(i) = A324290(j).
PROG
(PARI)
up_to = 101101; \\ = A002997(17).
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; };
A324291(n) = if(1==n, 1, my(f=factor(n), m=1); for(i=1, #f[, 1], m *= prime(1+((n-1)%(f[i, 1]-1)))); (m));
v324292 = rgs_transform(vector(up_to, n, A324291(n)));
A324292(n) = v324292[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 23 2019
STATUS
approved