|
|
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)
if n < 10: return 0
strn = str(n)
return int("".join(strn.rsplit(min(strn), 1)))
(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
|
|
|
KEYWORD
|
base,easy,dumb,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|