OFFSET
1,5
COMMENTS
Restricted growth sequence transform of A351092.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
PROG
(PARI)
up_to = 20000;
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; };
A019565(n) = { my(m=1, p=1); while(n>0, p = nextprime(1+p); if(n%2, m *= p); n >>= 1); (m); };
A289814(n) = { my(d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); }; \\ From A289814
v351094 = rgs_transform(vector(up_to, n, A351092(n)));
A351094(n) = v351094[n];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Antti Karttunen, Jan 31 2022
STATUS
approved