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 A004185 #61 Sep 08 2022 08:44:32 %S A004185 0,1,2,3,4,5,6,7,8,9,1,11,12,13,14,15,16,17,18,19,2,12,22,23,24,25,26, %T A004185 27,28,29,3,13,23,33,34,35,36,37,38,39,4,14,24,34,44,45,46,47,48,49,5, %U A004185 15,25,35,45,55,56,57,58,59,6,16,26,36,46,56,66,67,68,69,7,17,27,37,47 %N A004185 Arrange digits of n in increasing order, then (for n > 0) omit the zeros. %C A004185 Record values: A009994. - _Reinhard Zumkeller_, Dec 05 2009 %C A004185 If we define "sortable primes" as prime numbers that remain prime when their digits are sorted in increasing order, then all absolute primes (A003459) are sortable primes but not all sortable primes are absolute primes. For example, 311 is both sortable and absolute, and 271 is sortable but not absolute, since its digits can be permuted to 217 = 7 * 31 or 712 = 2^3 * 89, etc. - _Alonso del Arte_, Oct 05 2013 %C A004185 The above mentioned "sortable primes" are listed in A211654, the nontrivial ones (with digits not in nondecreasing order) in A086042. - _M. F. Hasler_, Jul 30 2019 %H A004185 Reinhard Zumkeller, <a href="/A004185/b004185.txt">Table of n, a(n) for n = 0..10000</a> %e A004185 a(19) = 19 because the digits are already in increasing order. %e A004185 a(20) = 2 because the digits of 20 are 2 and 0, which in increasing order are 0 and 2, but since zero-padding is not allowed on the left, the zero digit is dropped and we are left with 2. %e A004185 a(21) = 12 because the digits of 21 are 2 and 1, which in increasing order are 1 and 2. %p A004185 A004185 := proc(n) %p A004185 local dgs; %p A004185 convert(n,base,10) ; %p A004185 dgs := sort(%,`>`) ; %p A004185 add( op(i,dgs)*10^(i-1),i=1..nops(dgs)) ; %p A004185 end proc: %p A004185 seq(A004185(n),n=0..20) ; # _R. J. Mathar_, Jul 26 2015 %t A004185 FromDigits[Sort[DeleteCases[IntegerDigits[#], 0]]]&/@Range[0, 60] (* _Harvey P. Dale_, Nov 29 2011 *) %o A004185 (Haskell) %o A004185 import Data.List (sort) %o A004185 a004185 n = read $ sort $ show n :: Integer %o A004185 -- _Reinhard Zumkeller_, Aug 10 2011 %o A004185 (Magma) A004185:=func<n | Seqint(Reverse(Sort(Intseq(n))))>; [n eq 0 select 0 else A004185(n): n in [0..57]]; // _Bruno Berselli_, Apr 03 2012 %o A004185 (Python) %o A004185 def A004185(n): %o A004185 return int(''.join(sorted(str(n))).replace('0','')) if n > 0 else 0 # _Chai Wah Wu_, Nov 10 2015 %o A004185 (PARI) a(n)=fromdigits(vecsort(digits(n))) \\ _Charles R Greathouse IV_, Feb 06 2017 %Y A004185 Cf. A004719, A004151, A004086, A004186, A009996, A221714, A073138, A193581, A193582, A065641. %Y A004185 Cf. A211654 (sortable primes) and subsequence A086042 (nontrivial solutions). %K A004185 nonn,base,nice,easy,look %O A004185 0,3 %A A004185 _N. J. A. Sloane_