cp's OEIS Frontend

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.

Showing 1-1 of 1 results.

A383787 Largest number obtainable by either keeping each decimal digit d in n or replacing it with 9-d.

Original entry on oeis.org

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, 77, 78, 79, 69, 68, 67, 66, 65, 65, 66, 67, 68, 69, 59, 58, 57, 56, 55, 55, 56, 57, 58, 59, 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
Offset: 1

Views

Author

Ali Sada, May 09 2025

Keywords

Examples

			To find a(129) we replace 1 with 8 and 2 with 7. So, a(129) = 879.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := FromDigits[IntegerDigits[n] /. d_?(# < 5 &) -> 9 - d]; Array[a, 100] (* Amiram Eldar, May 10 2025 *)
  • PARI
    a(n) = fromdigits(apply(x->(if (x<5, 9-x, x)), digits(n))); \\ Michel Marcus, May 12 2025
  • Python
    def a(n): return int("".join(d if d>"4" else str(9-int(d)) for d in str(n)))
    print([a(n) for n in range(1, 79)]) # Michael S. Branicky, May 10 2025
    
Showing 1-1 of 1 results.