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.

A382102 Remove all occurrences of a digit from n such that the resulting number, formed by the remaining digits in their original order, is as small as possible. If no digits remain, a(n)=0.

This page as a plain text file.
%I A382102 #26 Mar 23 2025 23:21:18
%S A382102 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 A382102 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 A382102 6,0,1,2,3,4,5,6,0,7,7,0,1,2,3,4,5,6,7
%N A382102 Remove all occurrences of a digit from n such that the resulting number, formed by the remaining digits in their original order, is as small as possible. If no digits remain, a(n)=0.
%C A382102 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.
%C A382102 Starts to differ from A382056 at n=102. - _R. J. Mathar_, Mar 23 2025
%H A382102 Rémy Sigrist, <a href="/A382102/b382102.txt">Table of n, a(n) for n = 1..10000</a>
%e A382102 For n = 95, we remove (all copies of) the digit 9 and we get a(n) = 5.
%e A382102 For n = 88, we remove all copies of the digit 8 and we get a(88) = 0.
%e A382102 For n = 1917, we remove all copies of the digit 1 and we get a(n) = 97.
%t A382102 A382102[n_] := Min[Table[FromDigits[DeleteCases[#, d]], {d, DeleteDuplicates[#]}] & [IntegerDigits[n]]];
%t A382102 Array[A382102, 100] (* _Paolo Xausa_, Mar 23 2025 *)
%o A382102 (Python)
%o A382102 def f(s, r):
%o A382102     return int(s) if (s:=s.replace(r, "")) != "" else 0
%o A382102 def a(n):
%o A382102     s = str(n)
%o A382102     return min(f(s, d) for d in set(s))
%o A382102 print([a(n) for n in range(1, 88)]) # _Michael S. Branicky_, Mar 16 2025
%o A382102 (PARI) a(n, base = 10) = { my (d = digits(n, base), s = Set(d)); vecmin(apply(r -> fromdigits(select(t -> t!=r, d), base), s)) } \\ _Rémy Sigrist_, Mar 23 2025
%Y A382102 Cf. A382056.
%K A382102 nonn,base,look,nice
%O A382102 1,23
%A A382102 _Ali Sada_, Mar 15 2025