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.

Showing 1-3 of 3 results.

A355221 The k-th leftmost digit of a(n) is the least of the k leftmost digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 20, 21, 22, 22, 22, 22, 22, 22, 22, 22, 30, 31, 32, 33, 33, 33, 33, 33, 33, 33, 40, 41, 42, 43, 44, 44, 44, 44, 44, 44, 50, 51, 52, 53, 54, 55, 55, 55, 55, 55, 60, 61, 62, 63, 64, 65, 66, 66
Offset: 0

Views

Author

Rémy Sigrist, Jun 24 2022

Keywords

Comments

Leading zeros are ignored.

Examples

			For n = 1402: min({1}) = 1, min({1, 4}) = 1, min({1, 4, 0}) = 0, min({1, 4, 0, 2}) = 0, so a(1402) = 1100.
		

Crossrefs

See A355222, A355223 and A355224 for similar sequences.
Cf. A009996 (fixed points), A342126 (binary analog).

Programs

  • Mathematica
    Table[FromDigits[Table[Min[Take[IntegerDigits[n],d]],{d,IntegerLength[n]}]],{n,0,70}] (* Harvey P. Dale, Jun 30 2023 *)
  • PARI
    a(n, base=10) = { my (d=digits(n, base), m=oo); for (k=1, #d, d[k]=m=min(m, d[k])); fromdigits(d, base) }
    
  • Python
    def a(n):
        s, m = str(n), "9"
        return int("".join((m:=min(m, s[k])) for k in range(len(s))))
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jun 24 2022
    
  • Python
    from itertools import accumulate
    def A355221(n): return int(''.join(accumulate(str(n),func=min))) # Chai Wah Wu, Jun 25 2022

Formula

a(n) <= n with equality iff n belongs to A009996.
a(a(n)) = a(n).

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

Original entry on oeis.org

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, 27, 28, 29, 0, 11, 22, 33, 34, 35, 36, 37, 38, 39, 0, 11, 22, 33, 44, 45, 46, 47, 48, 49, 0, 11, 22, 33, 44, 55, 56, 57, 58, 59, 0, 11, 22, 33, 44, 55, 66, 67, 68
Offset: 0

Views

Author

Rémy Sigrist, Jun 24 2022

Keywords

Comments

Leading zeros are ignored.

Examples

			For n = 1402:
- min({1, 4, 0, 2}) = 0,
- min({4, 0, 2}) = 0,
- min({0, 2}) = 0,
- min({2}) = 2,
- so a(1402) = 2.
		

Crossrefs

See A355221, A355222 and A355224 for similar sequences.
Cf. A008592, A009994 (fixed points), A135481 (binary analog).

Programs

  • 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) }
    
  • Python
    def a(n):
        s, m = str(n), "9"
        return int("".join((m:=min(m, s[-1-k])) for k in range(len(s)))[::-1])
    print([a(n) for n in range(69)]) # Michael S. Branicky, Jun 24 2022
    
  • Python
    from itertools import accumulate
    def A355223(n): return int(''.join(accumulate(str(n)[::-1],func=min))[::-1]) # Chai Wah Wu, Jun 25 2022

Formula

a(n) <= n with equality iff n belongs to A009994.
a(a(n)) = a(n).
a(n) = 0 iff n is a multiple of 10.

A355224 The k-th rightmost digit of a(n) is the greatest of the k rightmost digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 22, 33, 44, 55, 66, 77, 88, 99, 20, 21, 22, 33, 44, 55, 66, 77, 88, 99, 30, 31, 32, 33, 44, 55, 66, 77, 88, 99, 40, 41, 42, 43, 44, 55, 66, 77, 88, 99, 50, 51, 52, 53, 54, 55, 66, 77, 88, 99, 60, 61, 62, 63, 64, 65, 66, 77
Offset: 0

Views

Author

Rémy Sigrist, Jun 24 2022

Keywords

Comments

Leading zeros are ignored.

Examples

			For n = 1402:
- max({1, 4, 0, 2}) = 4,
- max({4, 0, 2}) = 4,
- max({0, 2}) = 2,
- max({2}) = 2,
- so a(1402) = 4422.
		

Crossrefs

See A355221, A355222 and A355223 for similar sequences.
Cf. A009996 (fixed points), A340632 (binary analog).

Programs

  • Mathematica
    Table[FromDigits[Max/@Table[Drop[IntegerDigits[m],n],{n,0,IntegerLength[m]-1}]],{m,0,70}] (* Harvey P. Dale, Nov 17 2024 *)
  • PARI
    a(n, base=10) = { my (d=digits(n, base), m=-oo); forstep (k=#d, 1, -1, d[k]=m=max(m, d[k])); fromdigits(d, base) }
    
  • Python
    def a(n):
        s, m = str(n), "0"
        return int("".join((m:=max(m, s[-1-k])) for k in range(len(s)))[::-1])
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jun 24 2022
    
  • Python
    from itertools import accumulate
    def A355224(n): return int(''.join(accumulate(str(n)[::-1],func=max))[::-1]) # Chai Wah Wu, Jun 25 2022

Formula

a(n) >= n with equality iff n belongs to A009996.
a(a(n)) = a(n).
Showing 1-3 of 3 results.