login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A304740
Restricted growth sequence transform of A304760(n), formed from 1-digits in ternary representation of A254103(n).
8
1, 2, 1, 3, 3, 4, 1, 1, 5, 6, 6, 2, 3, 7, 6, 8, 9, 4, 1, 6, 10, 1, 1, 5, 5, 11, 11, 3, 10, 12, 12, 8, 13, 6, 6, 14, 3, 15, 11, 1, 16, 17, 12, 14, 3, 17, 12, 2, 9, 18, 19, 2, 20, 4, 1, 12, 16, 4, 1, 11, 21, 12, 12, 2, 22, 4, 1, 23, 10, 19, 19, 14, 5, 24, 24, 2, 20, 7, 6, 25, 26, 23, 23, 3, 21, 19, 19, 25, 5, 23, 23, 10, 21, 1, 1, 10, 13, 27, 27, 21, 28, 1, 1
OFFSET
0,2
LINKS
PROG
(PARI)
A254103(n) = if(!n, n, if(!(n%2), (3*A254103(n/2))-1, (3*(1+A254103((n-1)/2)))\2));
A289813(n) = { my (d=digits(n, 3)); from digits(vector(#d, i, if (d[i]==1, 1, 0)), 2); } \\ From A289813
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; };
v304740 = rgs_transform(vector(65538, n, A304760(n-1)));
A304740(n) = v304740[1+n];
CROSSREFS
Cf. also A304746.
Sequence in context: A325335 A262952 A245367 * A326619 A326567 A066328
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, May 29 2018
STATUS
approved