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”).

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

%I #18 Apr 13 2024 22:52:35

%S 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,

%T 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,

%U 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

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

%C a(A050278(1)) = a(1023456789) = 10, the first term with that value, as 1023456789 is the first base 10 pandigital number.

%C a(A052382(n)) = 0; a(A011540(n)) > 0. [_Reinhard Zumkeller_, May 04 2012]

%H Reinhard Zumkeller, <a href="/A067898/b067898.txt">Table of n, a(n) for n = 0..10000</a>

%e 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.

%o (Haskell)

%o import Data.List (delete)

%o a067898 n = f n [0..10] where

%o f x ys | x <= 9 = head $ delete x ys

%o | otherwise = f x' $ delete d ys where (x',d) = divMod x 10

%o -- _Reinhard Zumkeller_, May 04 2012

%o (Python)

%o def A067898(n):

%o s = set(str(n))

%o for i in range(10):

%o if str(i) not in s:

%o return i

%o return 10 # _Chai Wah Wu_, Apr 13 2024

%Y Cf. A050278 (pandigital numbers).

%Y Cf. A212193 (ternary).

%K base,easy,nonn

%O 0,11

%A _Rick L. Shepherd_, May 13 2003