[go: up one dir, main page]

login
A331300
Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = min(n, A057889(n)), and A057889 is a bijective base-2 reverse.
4
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 19, 22, 25, 26, 23, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 34, 38, 39, 40, 41, 42, 43, 44, 32, 35, 45, 40, 39, 46, 47, 48, 36, 42, 47, 49, 43, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 57, 62, 69, 70, 71, 72, 73, 74, 65, 75, 76, 77, 78, 79, 80, 81, 55, 58, 82, 64, 69, 83, 84, 74, 63
OFFSET
0,2
COMMENTS
Restricted growth sequence transform of A331166. See comments in that sequence.
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; };
A030101(n) = if(n<1, 0, subst(Polrev(binary(n)), x, 2));
A057889(n) = if(!n, n, A030101(n/(2^valuation(n, 2))) * (2^valuation(n, 2)));
A331166(n) = min(n, A057889(n));
v331300 = rgs_transform(vector(1+up_to, n, A331166(n-1)));
A331300(n) = v331300[1+n];
for(n=0, up_to, write("b331300.txt", n, " ", A331300(n)));
CROSSREFS
Cf. also A324400, A331303, A305801, A305801, A305900, A295300 for other "top level" filtering sequences.
Sequence in context: A291041 A291766 A291579 * A274933 A080331 A297247
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jan 18 2020
STATUS
approved