A116667 Greatest digit not used in n (or 10 if n is pandigital).
9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 9, 9, 9, 9, 9
Offset: 0
Examples
a(89) = 7 because decimal digits 8 and 9 are both used in 89.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
Programs
-
Python
def A116667(n): s = set(str(n)) for i in range(9,-1,-1): if str(i) not in s: return i return 10 # Chai Wah Wu, Apr 13 2024
Comments