login
A348287
Arrange nonzero digits of n in increasing order then append the zeros.
1
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,3
COMMENTS
Shares 101 initial terms with A328447. First difference is A328447(101)=101 vs A348287(101)=110.
EXAMPLE
a(1010) = 1100,
a(1234567890) = 1234567890,
a(9876543210) = 1234567890.
MATHEMATICA
a[n_] := 10^DigitCount[n, 10, 0] * FromDigits[Sort[IntegerDigits[n]]]; Array[a, 100, 0] (* Amiram Eldar, Oct 10 2021 *)
PROG
(PARI) a(n) = fromdigits(vecsort(digits(n), x->if(x, x, 10)));
(Ruby) p Array.new(40) { |n|
n.to_s.gsub('0', 'a').split(//).sort.join.gsub('a', '0').to_i
}
(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
CROSSREFS
Sequence in context: A056963 A291769 A167129 * A328447 A107602 A272215
KEYWORD
nonn,base
AUTHOR
Simon Strandgaard, Oct 10 2021
STATUS
approved