login
A328314
Lexicographically earliest infinite sequence such that a(i) = a(j) => A025586(i) = A025586(j) for all i, j.
1
1, 2, 3, 4, 3, 3, 5, 6, 5, 3, 5, 3, 7, 5, 8, 3, 5, 5, 9, 10, 11, 5, 8, 12, 9, 7, 13, 5, 9, 8, 13, 14, 15, 5, 8, 5, 16, 9, 17, 7, 13, 11, 18, 5, 19, 8, 13, 20, 21, 9, 22, 5, 8, 13, 13, 23, 18, 9, 17, 8, 24, 13, 13, 11, 18, 15, 17, 25, 26, 8, 13, 27, 13, 16, 28, 9, 22, 17, 29, 30, 31, 13, 13, 32, 33, 18, 34, 9, 17, 19, 13, 8, 35
OFFSET
1,2
COMMENTS
Restricted growth sequence transform of A025586, the largest value in '3x+1' trajectory of n.
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; };
A025586(n) = { my(r=n); while(n>2, if(n%2, n=3*n+1; if(n>r, r=n), n/=2)); (r); }; \\ From A025586
v328314 = rgs_transform(vector(up_to, n, A025586(n)));
A328314(n) = v328314[n];
CROSSREFS
Cf. A025586.
Cf. also A322973.
Sequence in context: A017839 A242294 A234347 * A286245 A279849 A106826
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 14 2019
STATUS
approved