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 A383787 #33 May 12 2025 10:35:24 %S A383787 8,7,6,5,5,6,7,8,9,89,88,87,86,85,85,86,87,88,89,79,78,77,76,75,75,76, %T A383787 77,78,79,69,68,67,66,65,65,66,67,68,69,59,58,57,56,55,55,56,57,58,59, %U A383787 59,58,57,56,55,55,56,57,58,59,69,68,67,66,65,65,66,67,68,69,79,78,77,76,75,75,76,77,78 %N A383787 Largest number obtainable by either keeping each decimal digit d in n or replacing it with 9-d. %H A383787 Michael De Vlieger, <a href="/A383787/b383787.txt">Table of n, a(n) for n = 1..10000</a> %H A383787 Michael De Vlieger, <a href="/A383787/a383787.png">Log log scatterplot of a(n)</a>, n = 1..10^6. %e A383787 To find a(129) we replace 1 with 8 and 2 with 7. So, a(129) = 879. %t A383787 a[n_] := FromDigits[IntegerDigits[n] /. d_?(# < 5 &) -> 9 - d]; Array[a, 100] (* _Amiram Eldar_, May 10 2025 *) %o A383787 (Python) %o A383787 def a(n): return int("".join(d if d>"4" else str(9-int(d)) for d in str(n))) %o A383787 print([a(n) for n in range(1, 79)]) # _Michael S. Branicky_, May 10 2025 %o A383787 (PARI) a(n) = fromdigits(apply(x->(if (x<5, 9-x, x)), digits(n))); \\ _Michel Marcus_, May 12 2025 %Y A383787 Cf. A061601, A383788. %K A383787 nonn,base %O A383787 1,1 %A A383787 _Ali Sada_, May 09 2025