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.

A354719 Replace each even digit in n with the digit to its left.

This page as a plain text file.
%I A354719 #52 Sep 03 2022 15:21:24
%S A354719 0,1,2,3,4,5,6,7,8,9,11,11,11,13,11,15,11,17,11,19,2,11,22,33,42,55,
%T A354719 62,77,82,99,33,31,33,33,33,35,33,37,33,39,4,11,24,33,44,55,64,77,84,
%U A354719 99,55,51,55,53,55,55,55,57,55,59,6,11,26,33,46,55,66,77
%N A354719 Replace each even digit in n with the digit to its left.
%C A354719 If the leftmost digit in n is even, wrap around and replace it with the rightmost digit in n (see example).
%H A354719 Michael De Vlieger, <a href="/A354719/b354719.txt">Table of n, a(n) for n = 0..10000</a>
%H A354719 Gavin Lupo, <a href="/A354719/a354719.png">Logarithmic scatterplot of (n, a(n)) for n = 1..10000</a>
%e A354719 n    =  4 2 7 8 1
%e A354719         ^ ^   ^      even digits,
%e A354719 a(n) =  1 4 7 7 1    to their left in n
%t A354719 Array[FromDigits@ Map[If[EvenQ@ #1, #2, #1] & @@ # &, Transpose@ {#, RotateRight[#, 1]}] &@ IntegerDigits[#] &, 67] (* _Michael De Vlieger_, Jun 19 2022 *)
%o A354719 (Python)
%o A354719 def a(n):
%o A354719     digits = list(map(int, str(n)))
%o A354719     out = (d if d%2 else digits[i-1] for i, d in enumerate(digits))
%o A354719     return int("".join(map(str, out)))
%o A354719 print([a(n) for n in range(68)]) # _Michael S. Branicky_, Jun 04 2022
%o A354719 (PARI) prec(d, k) = k--; if (! k, k = #d); k;
%o A354719 a(n) = my(d=digits(n), v=d); for (k=1, #d, if (!(d[k] % 2), v[k] = d[prec(d,k)])); fromdigits(v); \\ _Michel Marcus_, Jun 04 2022
%Y A354719 Cf. A139337, A348179, A349422.
%K A354719 nonn,base,easy,look,hear
%O A354719 0,3
%A A354719 _Gavin Lupo_, Jun 03 2022