login
A331742
Lexicographically earliest infinite sequence such that a(i) = a(j) => A323901(i) = A323901(j) for all i, j.
2
1, 1, 1, 2, 1, 3, 2, 4, 1, 5, 3, 6, 2, 3, 4, 4, 1, 7, 5, 8, 3, 9, 6, 10, 2, 11, 3, 10, 4, 5, 4, 12, 1, 13, 7, 14, 5, 15, 8, 16, 3, 17, 9, 18, 6, 19, 10, 20, 2, 17, 11, 18, 3, 9, 10, 21, 4, 22, 5, 8, 4, 22, 12, 12, 1, 23, 13, 24, 7, 25, 14, 26, 5, 27, 15, 28, 8, 19, 16, 29, 3, 30, 17, 31, 9, 32, 18, 33, 6, 34, 19, 33, 10, 35, 20, 36, 2, 35, 17, 37, 11, 38, 18, 14, 3, 34
OFFSET
0,4
COMMENTS
Restricted growth sequence transform of function A323901(n) = A002487(A163511(n)).
FORMULA
a(2^n) = 1 for all n >= 0.
PROG
(PARI)
\\ Needs also code from A323901.
up_to = 65537;
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; };
v331742 = rgs_transform(vector(1+up_to, n, A323901(n-1)));
A331742(n) = v331742[1+n];
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, Feb 05 2020
STATUS
approved