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.
%I A360443 #37 Jun 16 2025 23:49:16 %S A360443 10,20,30,40,50,60,70,80,90,100,101,21,31,41,51,61,71,81,91,200,102, %T A360443 202,32,42,52,62,72,82,92,300,103,203,303,43,53,63,73,83,93,400,104, %U A360443 204,304,404,54,64,74,84,94,500,105,205,305,405,505,65,75,85,95,600 %N A360443 Smallest integer m > n such that the multiset of nonzero decimal digits of m is exactly the same as the multiset of nonzero decimal digits of n. %C A360443 Equivalently: a(n) is the number whose decimal digits are the next larger permutation of those of n, allowing any number of leading zeros. %H A360443 M. F. Hasler, <a href="/A360443/b360443.txt">Table of n, a(n) for n = 1..1000</a> %H A360443 Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation#Generation_in_lexicographic_order">Permutation: Generation in lexicographic order</a>, as of Feb. 2023. %o A360443 (PARI) A360443(n)={forperm(concat(0,digits(n)),p,n||return(fromdigits(Vec(p))); n=0)} \\ _M. F. Hasler_, Feb 23 2023; similar idea also suggested by _Ruud H.G. van Tol_. %o A360443 (Python) # From _Arthur O'Dwyer_, edited by _M. F. Hasler_, Feb 22 2023 %o A360443 def A360443(n): %o A360443 s = '0' + str(n) %o A360443 i = next(i for i in range(len(s) - 1, 0, -1) if s[i-1] < s[i]) %o A360443 tail = s[i-1:] %o A360443 j = min((ch, j) for j, ch in enumerate(tail) if s[i-1] < ch)[1] %o A360443 s = s[:i-1] + tail[j] + ''.join(sorted(tail[:j] + tail[j+1:])) %o A360443 return int(s) %o A360443 for n in range(1, 100): print(n, A360443(n)) %Y A360443 Cf. A057168 (analog for base 2), A354049 (digits of a(n) contain those of n as sub-multiset). %Y A360443 Cf. A009994 (numbers with digits in nondecreasing order: don't appear in this sequence). %K A360443 nonn,easy,base %O A360443 1,1 %A A360443 _Marc LeBrun_ and _M. F. Hasler_, Feb 22 2023