A382056 Remove every copy of the largest digit of n; if any digits remain, return the number formed by arranging the remaining digits in nondecreasing order. If no digits remain, return 0.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 3, 3, 3, 3, 3, 3, 0, 1, 2, 3, 0, 4, 4, 4, 4, 4, 0, 1, 2, 3, 4, 0, 5, 5, 5, 5, 0, 1, 2, 3, 4, 5, 0, 6, 6, 6, 0, 1, 2, 3, 4, 5, 6, 0, 7, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0
Offset: 1
Examples
For n = 132, we remove the largest digit and we get a(132) = 12. For n = 66, we remove the largest digit and we get a(66) = 0.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..20000
Crossrefs
Programs
-
Maple
a:= n-> (l-> (m-> (h-> add(h[j]*10^(j-1), j=1..nops(h)) )(subs(m=NULL, l)))(max(l)))(convert(n, base, 10)): seq(a(n), n=1..102); # Alois P. Heinz, Mar 14 2025
-
Mathematica
A382056[n_] := FromDigits[DeleteCases[#, Max[#]]] & [IntegerDigits[n]]; Array[A382056, 100] (* Paolo Xausa, Mar 23 2025 *)
-
PARI
apply( {A382056(n, m=vecmax(digits(n)))=fromdigits([d | d<-digits(n), d
M. F. Hasler, Mar 14 2025 -
Python
def a(n): s = str(n) m = max(s) r = s.replace(m, "") return int(r) if r != "" else 0 print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Mar 13 2025
Formula
a(n) = 0 for n in A125289. - M. F. Hasler, Mar 14 2025
Extensions
Definition clarified by N. J. A. Sloane, Mar 23 2025
Comments