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

A116667
Greatest digit not used in n (or 10 if n is pandigital).
3
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,1
COMMENTS
a(A050278(1)) = a(1023456789) = 10, the first term with that value, as 1023456789 is the first base 10 pandigital number.
LINKS
EXAMPLE
a(89) = 7 because decimal digits 8 and 9 are both used in 89.
PROG
(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
CROSSREFS
Cf. A067898 (least digit not used in n), A050278 (pandigital numbers).
Sequence in context: A363018 A269351 A363117 * A259151 A270172 A332550
KEYWORD
base,easy,nonn
AUTHOR
Rick L. Shepherd, Feb 22 2006
STATUS
approved