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 A261787 #7 Feb 05 2022 16:23:32 %S A261787 1,2,1,2,2,3,1,3,1,2,2,4,2,2,3,3,3,3,1,3,1,4,3,3,1,3,1,2,2,4,2,2,4,4, %T A261787 4,4,2,2,5,2,2,3,3,3,3,3,3,3,4,3,3,3,3,3,1,3,1,4,3,3,1,3,1,4,4,4,5,3, %U A261787 3,3,3,3,1,3,1,4,3,3,1,3,1,2,2,4,2,2 %N A261787 a(n) is the smallest nonzero number that is not a substring of n in ternary representation. %H A261787 Reinhard Zumkeller, <a href="/A261787/b261787.txt">Table of n, a(n) for n = 0..10000</a> %F A261787 A261789(n) = a(A261786(n)). %o A261787 (Haskell) %o A261787 import Data.List (isInfixOf) %o A261787 a261787 x = f $ tail a030341_tabf where %o A261787 f (cs:css) = if isInfixOf cs (a030341_row x) %o A261787 then f css else foldr (\d v -> 3 * v + d) 0 cs %o A261787 (PARI) ts(n) = Str(fromdigits(digits(n, 3))); %o A261787 a(n) = my(s=ts(n), k=1); while (#strsplit(s, ts(k)) != 1, k++); k; \\ _Michel Marcus_, Feb 05 2022 %Y A261787 Cf. A007089, A030341, A261789, A261786, A261461, A261794. %K A261787 nonn,base %O A261787 0,2 %A A261787 _Reinhard Zumkeller_, Sep 01 2015