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.

A348287 Arrange nonzero digits of n in increasing order then append the zeros.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 22, 23, 24, 25, 26, 27, 28, 29, 30, 13, 23, 33, 34, 35, 36, 37, 38, 39, 40, 14, 24, 34, 44, 45, 46, 47, 48, 49, 50, 15, 25, 35, 45, 55, 56, 57, 58, 59, 60, 16, 26, 36, 46, 56, 66
Offset: 0

Views

Author

Simon Strandgaard, Oct 10 2021

Keywords

Comments

Shares 101 initial terms with A328447. First difference is A328447(101)=101 vs A348287(101)=110.

Examples

			a(1010) = 1100,
a(1234567890) = 1234567890,
a(9876543210) = 1234567890.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := 10^DigitCount[n, 10, 0] * FromDigits[Sort[IntegerDigits[n]]]; Array[a, 100, 0] (* Amiram Eldar, Oct 10 2021 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n), x->if(x,x,10)));
    
  • Python
    def a(n): s = str(n); return int("".join(sorted(s)))*10**s.count('0')
    print([a(n) for n in range(68)]) # Michael S. Branicky, Oct 10 2021
  • Ruby
    p Array.new(40) { |n|
      n.to_s.gsub('0','a').split(//).sort.join.gsub('a','0').to_i
    }