A261794 a(n) is the smallest nonzero number that is not a substring of n in decimal representation.
1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Programs
-
Haskell
import Data.List (isInfixOf) a261794 x = f $ tail a031298_tabf where f (cs:css) = if isInfixOf cs (a031298_row x) then f css else foldr (\d v -> 10 * v + d) 0 cs
Extensions
Name corrected by Álvar Ibeas, Sep 08 2020
Comments