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 A328447 #26 Dec 06 2021 03:15:36 %S A328447 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, %T A328447 26,27,28,29,30,13,23,33,34,35,36,37,38,39,40,14,24,34,44,45,46,47,48, %U A328447 49,50,15,25,35,45,55,56,57,58,59,60,16,26,36,46,56,66,67,68,69,70,17,27,37,47,57,67 %N A328447 Smallest representative of the class of numbers having the same digits as n up to permutation. %C A328447 Sort the digits in increasing order. If the list starts with a digit 0, move the smallest nonzero digit to the front. %C A328447 Every term is in A179239. - _David A. Corneth_, Oct 17 2019 %H A328447 Robert Israel, <a href="/A328447/b328447.txt">Table of n, a(n) for n = 0..10000</a> %e A328447 a(201) = 102: largest digits go to the end, but the smallest nonzero digit must go first. %p A328447 f:= proc(n) local L,i,t; %p A328447 L:= sort(convert(n,base,10)); %p A328447 if L[1]=0 then %p A328447 t:= numboccur(0,L)+1; %p A328447 L:= [L[t],op(L[1..t-1]),op(L[t+1..-1])]; %p A328447 fi; %p A328447 add(L[-i]*10^(i-1),i=1..nops(L)) %p A328447 end proc: %p A328447 f(0):= 0: %p A328447 map(f, [$0..100]); %t A328447 Array[FromDigits@ If[First@ # == 0, Flatten@ MapAt[Reverse, TakeDrop[#, 2], 1], #] &@ Sort@ IntegerDigits[#] &, 67] (* _Michael De Vlieger_, Oct 17 2019 *) %o A328447 (PARI) A328447(n)={if(n=vecsort(digits(n)), n[1]|| for(k=2,#n,n[k]&&[n[1]=n[k],n[k]=0,break]));fromdigits(n)} %o A328447 (Python) %o A328447 def A328447(n): %o A328447 if n == 0: return 0 %o A328447 s = str(n) %o A328447 l, s = len(s), ''.join(sorted(s.replace('0',''))) %o A328447 return int(s[0]+'0'*(l-len(s))+s[1:]) # _Chai Wah Wu_, Dec 06 2021 %Y A328447 Cf. A179239, A004186 (largest representative of the class of n). %K A328447 nonn,base,easy,look %O A328447 0,3 %A A328447 _M. F. Hasler_, Oct 15 2019