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.

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

This page as a plain text file.
%I A383788 #33 May 12 2025 10:02:08
%S A383788 1,2,3,4,4,3,2,1,0,10,11,12,13,14,14,13,12,11,10,20,21,22,23,24,24,23,
%T A383788 22,21,20,30,31,32,33,34,34,33,32,31,30,40,41,42,43,44,44,43,42,41,40,
%U A383788 40,41,42,43,44,44,43,42,41,40,30,31,32,33,34,34,33,32,31,30,20,21,22,23,24,24,23,22
%N A383788 Smallest number obtainable by either keeping each decimal digit d in n or replacing it with 9-d.
%e A383788 To find a(346), we replace 6 with 3. So, a(346) = 343.
%t A383788 a[n_] := FromDigits[IntegerDigits[n] /. d_?(# > 4 &) -> 9 - d]; Array[a, 100] (* _Amiram Eldar_, May 10 2025 *)
%o A383788 (Python)
%o A383788 def a(n): return int("".join(d if d<"5" else str(9-int(d)) for d in str(n)))
%o A383788 print([a(n) for n in range(1, 78)]) # _Michael S. Branicky_, May 10 2025
%o A383788 (PARI) a(n) = fromdigits(apply(x->(if (x>4, 9-x, x)), digits(n))); \\ _Michel Marcus_, May 12 2025
%Y A383788 Cf. A061601, A383787.
%K A383788 nonn,base
%O A383788 1,2
%A A383788 _Ali Sada_, May 09 2025