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.

A340184 n with the rightmost occurrence of the smallest digit of n deleted.

This page as a plain text file.
%I A340184 #56 Jun 30 2025 15:29:15
%S A340184 0,0,0,0,0,0,0,0,0,0,1,1,2,3,4,5,6,7,8,9,2,2,2,3,4,5,6,7,8,9,3,3,3,3,
%T A340184 4,5,6,7,8,9,4,4,4,4,4,5,6,7,8,9,5,5,5,5,5,5,6,7,8,9,6,6,6,6,6,6,6,7,
%U A340184 8,9,7,7,7,7,7,7,7,7,8,9,8,8,8,8,8,8,8,8,8,9
%N A340184 n with the rightmost occurrence of the smallest digit of n deleted.
%C A340184 Suggested by _Eric Angelini_'s posting to Math-Fun Mailing List, Dec 29 2020.
%e A340184 For n = 32522529, the smallest digit is 2, and its rightmost occurrence is at the tens position, so a(n) = 3252259.
%p A340184 leastdigit:=proc(n)
%p A340184   min(convert(n,base,10));
%p A340184 end:
%p A340184 locationdigit:=proc(n,d)
%p A340184 local L,i;
%p A340184 L:=convert(n,base,10);
%p A340184 for i from 1 to nops(L) do
%p A340184    if d = L[i] then return (nops(L)+1-i); fi;
%p A340184 od:
%p A340184 end:
%p A340184 cutout:=proc(X,i)
%p A340184 [seq(X[j],j=1..i-1),seq(X[j],j=i+1..nops(X))];
%p A340184 end:
%p A340184 ToNum:=proc(X)
%p A340184   add(X[i]*10^(nops(X)-i),i=1..nops(X));
%p A340184 end:
%p A340184 a:=proc(n)
%p A340184 local i,X;
%p A340184 i:=locationdigit(n,leastdigit(n));
%p A340184 X:=ListTools:-Reverse(convert(n,base,10));
%p A340184 ToNum(cutout(X,i));
%p A340184 end proc:
%o A340184 (Python)
%o A340184 def A340184(n):
%o A340184   if n < 10: return 0
%o A340184   strn = str(n)
%o A340184   return int("".join(strn.rsplit(min(strn), 1)))
%o A340184 print([A340184(n) for n in range(90)]) # _Michael S. Branicky_, Jan 03 2021
%o A340184 (PARI) a(n) = if (n<10, 0, my(d=digits(n), x=vecmin(d), s=""); forstep (k=#d, 1, -1, if (d[k] != x, s = concat(d[k], s), x=-1)); eval(s)); \\ _Michel Marcus_, Jan 03 2021; corrected Jun 13 2022
%o A340184 (PARI) apply( {A340184(n,m=vecmin(n=digits(n)))=#n>1&&forstep(i=#n,1,-1, n[i]==m && return(fromdigits(n[^i])));m}, [1..200]) \\ _M. F. Hasler_, Jan 03 2021
%Y A340184 Cf. A054054 (smallest digit of n).
%K A340184 base,easy,dumb,nonn
%O A340184 0,13
%A A340184 _W. Edwin Clark_, Jan 02 2021