login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354719 Replace each even digit in n with the digit to its left. 1
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, 62, 77, 82, 99, 33, 31, 33, 33, 33, 35, 33, 37, 33, 39, 4, 11, 24, 33, 44, 55, 64, 77, 84, 99, 55, 51, 55, 53, 55, 55, 55, 57, 55, 59, 6, 11, 26, 33, 46, 55, 66, 77 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
If the leftmost digit in n is even, wrap around and replace it with the rightmost digit in n (see example).
LINKS
EXAMPLE
n = 4 2 7 8 1
^ ^ ^ even digits,
a(n) = 1 4 7 7 1 to their left in n
MATHEMATICA
Array[FromDigits@ Map[If[EvenQ@ #1, #2, #1] & @@ # &, Transpose@ {#, RotateRight[#, 1]}] &@ IntegerDigits[#] &, 67] (* Michael De Vlieger, Jun 19 2022 *)
PROG
(Python)
def a(n):
digits = list(map(int, str(n)))
out = (d if d%2 else digits[i-1] for i, d in enumerate(digits))
return int("".join(map(str, out)))
print([a(n) for n in range(68)]) # Michael S. Branicky, Jun 04 2022
(PARI) prec(d, k) = k--; if (! k, k = #d); k;
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
CROSSREFS
Sequence in context: A338830 A262037 A262039 * A340835 A123241 A355222
KEYWORD
nonn,base,easy,look,hear
AUTHOR
Gavin Lupo, Jun 03 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 9 02:21 EDT 2024. Contains 374171 sequences. (Running on oeis4.)