cp's OEIS Frontend

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.

A067898 Least digit not used in n (or 10 if n is pandigital).

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 2, 2
Offset: 0

Views

Author

Rick L. Shepherd, May 13 2003

Keywords

Comments

a(A050278(1)) = a(1023456789) = 10, the first term with that value, as 1023456789 is the first base 10 pandigital number.
a(A052382(n)) = 0; a(A011540(n)) > 0. [Reinhard Zumkeller, May 04 2012]

Examples

			a(10)=2 because decimal digits 0 and 1 are both used in 10, a(102)=3 because decimal digits 0, 1 and 2 are used in 102.
		

Crossrefs

Cf. A050278 (pandigital numbers).
Cf. A212193 (ternary).

Programs

  • Haskell
    import Data.List (delete)
    a067898 n = f n [0..10] where
       f x ys | x <= 9    = head $ delete x ys
              | otherwise = f x' $ delete d ys where (x',d) = divMod x 10
    -- Reinhard Zumkeller, May 04 2012
    
  • Python
    def A067898(n):
        s = set(str(n))
        for i in range(10):
            if str(i) not in s:
                return i
        return 10 # Chai Wah Wu, Apr 13 2024