login
A366262
Lexicographically earliest infinite sequence such that a(i) = a(j) => A366261(i) = A366261(j) for all i, j >= 0.
4
1, 2, 3, 2, 3, 2, 4, 5, 6, 2, 4, 7, 4, 5, 3, 7, 8, 2, 4, 7, 4, 7, 4, 9, 8, 10, 3, 7, 11, 7, 6, 5, 6, 2, 4, 7, 4, 7, 4, 9, 8, 12, 4, 9, 13, 9, 8, 7, 13, 12, 3, 7, 11, 7, 11, 7, 13, 14, 15, 5, 8, 14, 8, 10, 15, 2, 4, 7, 4, 7, 4, 9, 8, 12, 4, 9, 13, 9, 8, 7, 13, 16, 4, 9, 13, 9, 13, 9, 17, 16, 18, 7, 13, 19, 13, 12, 8, 10
OFFSET
0,2
COMMENTS
Restricted growth sequence transform of A366261.
For all i, j >= 0: a(i) = a(j) => A366254(i) = A366254(j).
LINKS
PROG
(PARI)
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; };
A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };
A209229(n) = (n && !bitand(n, n-1));
A053644(n) = { my(k=1); while(k<=n, k<<=1); (k>>1); };
A303767(n) = if(!n, n, if(A209229(n), n+A303767(n-1), A053644(n)+A303767(n-A053644(n)-1)));
A366260(n) = A005940(1+A303767(n));
v366262 = rgs_transform(vector(1+up_to, n, A366261(n-1)));
A366262(n) = v366262[1+n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 05 2023
STATUS
approved