OFFSET
0,2
COMMENTS
Restricted growth sequence transform of A331173. See comments in that sequence.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..100000
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; };
A030102(n) = { my(r=[n%3]); while(0<n\=3, r=concat(n%3, r)); subst(Polrev(r), x, 3); };
v331303 = rgs_transform(vector(1+up_to, n, A331173(n-1)));
A331303(n) = v331303[1+n];
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jan 18 2020
STATUS
approved