cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A382056 #24 Mar 23 2025 23:20:02
%S A382056 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,
%T A382056 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,
%U A382056 6,0,1,2,3,4,5,6,0,7,7,0,1,2,3,4,5,6,7,0
%N 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.
%C A382056 This sequence is inspired by a joke from Finnish comedian ISMO: "The hardest part in English for me is silent letters. You write them down but never say. But since you have silent letters in the language, why don’t you also have silent numbers? They would be far more useful. Like, I owe you 75 dollars, but the 7 is silent."
%H A382056 Alois P. Heinz, <a href="/A382056/b382056.txt">Table of n, a(n) for n = 1..20000</a>
%F A382056 a(n) = 0 for n in A125289. - _M. F. Hasler_, Mar 14 2025
%e A382056 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.
%p A382056 a:= n-> (l-> (m-> (h-> add(h[j]*10^(j-1), j=1..nops(h))
%p A382056      )(subs(m=NULL, l)))(max(l)))(convert(n, base, 10)):
%p A382056 seq(a(n), n=1..102);  # _Alois P. Heinz_, Mar 14 2025
%t A382056 A382056[n_] := FromDigits[DeleteCases[#, Max[#]]] & [IntegerDigits[n]];
%t A382056 Array[A382056, 100] (* _Paolo Xausa_, Mar 23 2025 *)
%o A382056 (Python)
%o A382056 def a(n):
%o A382056     s = str(n)
%o A382056     m = max(s)
%o A382056     r = s.replace(m, "")
%o A382056     return int(r) if r != "" else 0
%o A382056 print([a(n) for n in range(1, 103)]) # _Michael S. Branicky_, Mar 13 2025
%o A382056 (PARI) apply( {A382056(n, m=vecmax(digits(n)))=fromdigits([d | d<-digits(n), d<m])}, [1..99]) \\ _M. F. Hasler_, Mar 14 2025
%Y A382056 Cf. A054055 (largest digit of n), A125289 (numbers with only one (distinct) digit > 0), A382401.
%K A382056 nonn,look,base
%O A382056 1,23
%A A382056 _Ali Sada_, Mar 13 2025
%E A382056 Definition clarified by _N. J. A. Sloane_, Mar 23 2025