OFFSET
1,12
COMMENTS
A variant of A382102.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 95, we remove (all copies of) the digit 5 and we get a(n) = 9.
For n = 88, we remove all copies of the digit 8 and we get a(88) = 0.
For n = 1917, we remove all copies of the digit 7 and we get a(n) = 191.
MATHEMATICA
A382371[n_] := Max[Table[FromDigits[DeleteCases[#, d]], {d, DeleteDuplicates[#]}] & [IntegerDigits[n]]];
Array[A382371, 100] (* Paolo Xausa, Mar 23 2025 *)
PROG
(PARI) a(n, base = 10) = { my (d = digits(n, base), s = Set(d)); vecmax(apply(r -> fromdigits(select(t -> t!=r, d), base), s)) }
(Python)
def f(s, r):
return int(s) if (s:=s.replace(r, "")) != "" else 0
def a(n):
s = str(n)
return max(f(s, d) for d in set(s))
print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Mar 23 2025
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Mar 23 2025
STATUS
approved
