login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A340184 n with the rightmost occurrence of the smallest digit of n deleted. 2
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, 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, 8, 9, 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,13
COMMENTS
Suggested by Eric Angelini's posting to Math-Fun Mailing List, Dec. 29, 2020.
LINKS
EXAMPLE
For n = 32522529, the smallest digit is 2, and its rightmost occurrence is at the tens position, so a(n) = 3252259.
MAPLE
leastdigit:=proc(n)
min(convert(n, base, 10));
end:
locationdigit:=proc(n, d)
local L, i;
L:=convert(n, base, 10);
for i from 1 to nops(L) do
if d = L[i] then return (nops(L)+1-i); fi;
od:
end:
cutout:=proc(X, i)
[seq(X[j], j=1..i-1), seq(X[j], j=i+1..nops(X))];
end:
ToNum:=proc(X)
add(X[i]*10^(nops(X)-i), i=1..nops(X));
end:
a:=proc(n)
local i, X;
i:=locationdigit(n, leastdigit(n));
X:=ListTools:-Reverse(convert(n, base, 10));
ToNum(cutout(X, i));
end proc:
PROG
(Python)
def A340184(n):
if n < 10: return 0
strn = str(n)
return int("".join(strn.rsplit(min(strn), 1)))
print([A340184(n) for n in range(90)]) # Michael S. Branicky, Jan 03 2021
(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
(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
CROSSREFS
Cf. A054054 (smallest digit of n).
Sequence in context: A138795 A297233 A177895 * A238986 A227876 A276716
KEYWORD
base,easy,dumb,nonn
AUTHOR
W. Edwin Clark, Jan 02 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 13 18:16 EDT 2024. Contains 374285 sequences. (Running on oeis4.)