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 A338829 #19 Nov 14 2020 01:50:11 %S A338829 0,1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,91,11,21,31,41,51,61, %T A338829 71,81,82,92,12,22,32,42,52,62,72,73,83,93,13,23,33,43,53,63,64,74,84, %U A338829 94,14,24,34,44,54,55,65,75,85,95,15,25,35,45,46,56,66,76 %N A338829 a(n) is the greatest number not yet in the sequence with the same number of digits and the same sum of digits as n. %C A338829 This sequence is a self-inverse permutation of the nonnegative integers. %C A338829 We have a fixed point with m digits and sum of digits k whenever A289410(m, k) is odd. %H A338829 Rémy Sigrist, <a href="/A338829/b338829.txt">Table of n, a(n) for n = 0..9999</a> %H A338829 Rémy Sigrist, <a href="/A338829/a338829.png">Colored scatterplot of the first 10000 terms</a> (where the color is function of the sum of digits of n) %H A338829 Rémy Sigrist, <a href="/A338829/a338829.gp.txt">PARI program for A338829</a> %H A338829 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A338829 A055642(a(n)) = A055642(n). %F A338829 A007953(a(n)) = A007953(n). %e A338829 For n = 23: %e A338829 - the numbers with 2 digits and sum of digits 5 are: 14, 23, 32, 41 and 50, %e A338829 - so a(14) = 50, %e A338829 a(23) = 41, %e A338829 a(32) = 32, %e A338829 a(41) = 23, %e A338829 a(50) = 14. %t A338829 Block[{a = {}, f, k}, f[x_] := Total@ IntegerDigits@ x; Do[k = f[i]; AppendTo[a, SelectFirst[Range[10^# - 1, 10^(# - 1), -1] &@ Floor[1 + Log10[i]], And[f[#] == k, FreeQ[a, #]] &]], {i, 67}]; a] (* _Michael De Vlieger_, Nov 13 2020 *) %o A338829 (PARI) See Links section. %Y A338829 Cf. A055642, A289410, A331274 (binary analog), A333659, A338834 (factorial base analog), A338835 (primorial base analog). %K A338829 nonn,base %O A338829 0,3 %A A338829 _Rémy Sigrist_, Nov 11 2020