This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A329424 #22 Feb 28 2020 00:27:28 %S A329424 0,1,2,1,4,5,2,7,8,1,10,11,4,13,14,5,16,17,2,19,20,7,22,23,8,25,26,1, %T A329424 28,29,10,11,4,11,14,5,4,17,2,13,40,41,14,43,44,5,46,47,16,49,50,17, %U A329424 52,53,2,55,56,19,58,59,20,7,22,7,8,25,22,1,28,23,70,71 %N A329424 Starting from n: as long as the decimal representation starts with a positive multiple of 3, divide the largest such prefix by 3; a(n) corresponds to the final value. %C A329424 As long as we have a number whose decimal representation is the concatenation of a positive multiple of 3, say u, and a minimal string possibly empty, say v, we replace this number with the concatenation of u/3 and v; eventually none of the prefixes will be a positive multiple of 3. %H A329424 Rémy Sigrist, <a href="/A329424/b329424.txt">Table of n, a(n) for n = 0..10000</a> %F A329424 a(n) <= n. %e A329424 For n = 1011: %e A329424 - 1011 gives 1011/3 = 337, %e A329424 - 337 gives 33/3 followed by 7 = 117, %e A329424 - 117 gives 117/3 = 39, %e A329424 - 39 gives 39/3 = 13, %e A329424 - neither 1 nor 13 is a multiple of 3, so a(1011) = 13. %o A329424 (PARI) t(n) = if (n==0, 0, n%3==0, n/3, 10*t(n\10)+(n%10)) %o A329424 a(n) = while (n!=n=t(n),); n %Y A329424 See A327539 for similar sequences. %K A329424 nonn,base %O A329424 0,3 %A A329424 _Rémy Sigrist_, Nov 30 2019