|
|
A306436
|
|
Rewrite n by substituting each digit d of n by d-1 if d is odd, d+1 otherwise.
|
|
2
|
|
|
1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 31, 30, 33, 32, 35, 34, 37, 36, 39, 38, 21, 20, 23, 22, 25, 24, 27, 26, 29, 28, 51, 50, 53, 52, 55, 54, 57, 56, 59, 58, 41, 40, 43, 42, 45, 44, 47, 46, 49, 48, 71, 70, 73, 72, 75, 74, 77, 76, 79, 78, 61, 60, 63, 62, 65, 64, 67, 66, 69, 68, 91, 90, 93, 92, 95, 94, 97, 96, 99, 98, 81, 80, 83, 82, 85, 84, 87, 86, 89, 88, 11, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
The original name was: The nonnegative integers, the ten successive digits being swapped by pairs.
0<->1, 2<->3, 4<->5, 6<->7, 8<->9.
|
|
LINKS
|
|
|
EXAMPLE
|
a(0)=1, a(1)=0, a(2)=3, ... , a(10)=01=1, a(11)=00=0, a(12)=03=3, ... , a(20)=31, ... , a(100)=011=11, a(101)=010=10, a(102)=013=13.
a(2n) = 1, 3, 5, 7, 9, 1, 3, 5, 7, 9, 31, 33, 35, 37, 39, 21, 23, 25, 27, 29, 51, ... .
|
|
MAPLE
|
f:= proc(n) option remember; local d;
d:= n mod 10;
d + (-1)^d + 10*procname((n-d)/10)
end proc:
for i from 0 to 9 do f(i):= i + (-1)^i od:
|
|
MATHEMATICA
|
|
|
PROG
|
(PARI) substi(d)=my(vs = [1, 0, 3, 2, 5, 4, 7, 6, 9, 8]); fromdigits(apply(x->vs[x+1], d));
a(n) = if (n==0, substi([0]), substi(digits(n))); \\ Michel Marcus, Feb 15 2019
(Python)
def A306436(n): return int(str(n).translate({48:49, 49:48, 50:51, 51:50, 52:53, 53:52, 54:55, 55:54, 56:57, 57:56})) # Chai Wah Wu, Apr 07 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|