login
a(n) = n plus the sorted version of the base-10 digits of n.
4

%I #15 Jan 15 2024 15:02:33

%S 0,2,4,6,8,10,12,14,16,18,11,22,24,26,28,30,32,34,36,38,22,33,44,46,

%T 48,50,52,54,56,58,33,44,55,66,68,70,72,74,76,78,44,55,66,77,88,90,92,

%U 94,96,98,55,66,77,88,99,110,112,114,116,118,66,77,88,99,110,121,132,134

%N a(n) = n plus the sorted version of the base-10 digits of n.

%H Reinhard Zumkeller, <a href="/A070196/b070196.txt">Table of n, a(n) for n = 0..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Sort-Then-AddSequence.html">Sort-Then-Add Sequence</a>

%F a(n) = n + A004185(n). - _Reinhard Zumkeller_, Apr 03 2015

%p a:= n-> n+parse(cat(sort(convert(n, base, 10))[])):

%p seq(a(n), n=0..67); # _Alois P. Heinz_, Jan 15 2024

%t Table[n+FromDigits[Sort[IntegerDigits[n]]],{n,0,70}] (* _Harvey P. Dale_, Feb 08 2020 *)

%o (Haskell)

%o a070196 n = n + a004185 n -- _Reinhard Zumkeller_, Apr 03 2015

%o (Python)

%o def a(n): return n + int("".join(sorted(str(n))))

%o print([a(n) for n in range(68)]) # _Michael S. Branicky_, Jan 15 2024

%Y Cf. A033862.

%Y Cf. A004185, A033860 (iterated, starting with 1).

%K nonn,base

%O 0,2

%A _Eric W. Weisstein_, Apr 27 2002

%E Zero prepended and offset changed by _Reinhard Zumkeller_, Apr 03 2015