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.

A355223 The k-th rightmost digit of a(n) is the least of the k rightmost digits of n.

This page as a plain text file.
%I A355223 #11 Jun 26 2022 09:15:35
%S A355223 0,1,2,3,4,5,6,7,8,9,0,11,12,13,14,15,16,17,18,19,0,11,22,23,24,25,26,
%T A355223 27,28,29,0,11,22,33,34,35,36,37,38,39,0,11,22,33,44,45,46,47,48,49,0,
%U A355223 11,22,33,44,55,56,57,58,59,0,11,22,33,44,55,66,67,68
%N A355223 The k-th rightmost digit of a(n) is the least of the k rightmost digits of n.
%C A355223 Leading zeros are ignored.
%H A355223 Rémy Sigrist, <a href="/A355223/b355223.txt">Table of n, a(n) for n = 0..10000</a>
%F A355223 a(n) <= n with equality iff n belongs to A009994.
%F A355223 a(a(n)) = a(n).
%F A355223 a(n) = 0 iff n is a multiple of 10.
%e A355223 For n = 1402:
%e A355223 - min({1, 4, 0, 2}) = 0,
%e A355223 - min({4, 0, 2}) = 0,
%e A355223 - min({0, 2}) = 0,
%e A355223 - min({2}) = 2,
%e A355223 - so a(1402) = 2.
%o A355223 (PARI) a(n, base=10) = { my (d=digits(n, base), m=oo); forstep (k=#d, 1, -1, d[k]=m=min(m, d[k])); fromdigits(d, base) }
%o A355223 (Python)
%o A355223 def a(n):
%o A355223     s, m = str(n), "9"
%o A355223     return int("".join((m:=min(m, s[-1-k])) for k in range(len(s)))[::-1])
%o A355223 print([a(n) for n in range(69)]) # _Michael S. Branicky_, Jun 24 2022
%o A355223 (Python)
%o A355223 from itertools import accumulate
%o A355223 def A355223(n): return int(''.join(accumulate(str(n)[::-1],func=min))[::-1]) # _Chai Wah Wu_, Jun 25 2022
%Y A355223 See A355221, A355222 and A355224 for similar sequences.
%Y A355223 Cf. A008592, A009994 (fixed points), A135481 (binary analog).
%K A355223 nonn,base,easy
%O A355223 0,3
%A A355223 _Rémy Sigrist_, Jun 24 2022