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.
%I A306436 #31 Nov 13 2023 08:45:24 %S A306436 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, %T A306436 38,21,20,23,22,25,24,27,26,29,28,51,50,53,52,55,54,57,56,59,58,41,40, %U A306436 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 %N A306436 Rewrite n by substituting each digit d of n by d-1 if d is odd, d+1 otherwise. %C A306436 The original name was: The nonnegative integers, the ten successive digits being swapped by pairs. %C A306436 0<->1, 2<->3, 4<->5, 6<->7, 8<->9. %H A306436 Robert Israel, <a href="/A306436/b306436.txt">Table of n, a(n) for n = 0..10000</a> %e A306436 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. %e A306436 a(2n) = 1, 3, 5, 7, 9, 1, 3, 5, 7, 9, 31, 33, 35, 37, 39, 21, 23, 25, 27, 29, 51, ... . %p A306436 f:= proc(n) option remember; local d; %p A306436 d:= n mod 10; %p A306436 d + (-1)^d + 10*procname((n-d)/10) %p A306436 end proc: %p A306436 for i from 0 to 9 do f(i):= i + (-1)^i od: %p A306436 map(f, [$0..100]); # _Robert Israel_, Feb 20 2019 %t A306436 A306436[n_]:=FromDigits[Map[#+If[OddQ[#],-1,1]&,IntegerDigits[n]]];Array[A306436,100,0] (* _Paolo Xausa_, Nov 13 2023 *) %o A306436 (PARI) substi(d)=my(vs = [1,0,3,2,5,4,7,6,9,8]); fromdigits(apply(x->vs[x+1], d)); %o A306436 a(n) = if (n==0, substi([0]), substi(digits(n))); \\ _Michel Marcus_, Feb 15 2019 %o A306436 (Python) %o A306436 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 %Y A306436 Cf. A001477. %K A306436 nonn,base,easy %O A306436 0,3 %A A306436 _Paul Curtz_, Feb 15 2019 %E A306436 Name changed by _Paolo Xausa_, Nov 13 2023