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 A333470 #12 Mar 15 2025 12:49:58 %S A333470 1,3,2,4,5,6,7,9,8,11,10,13,12,15,14,16,17,18,19,20,21,22,23,24,25,26, %T A333470 27,28,29,30,31,33,32,35,34,37,36,39,38,41,40,43,42,45,44,47,46,49,48, %U A333470 51,50,53,52,55,54,57,56,59,58,61,60,63,62,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80 %N A333470 Lexicographically earliest sequence of distinct positive terms such that a(n) is the number of commas that a(n) has to step over (to the right) to be met by an odd term. This odd term might not be the closest odd term to a(n). %H A333470 Dominic McCarty, <a href="/A333470/b333470.txt">Table of n, a(n) for n = 1..10000</a> %F A333470 a(n) = n for n in A053738. Otherwise, a(n) = n+1 for even n and a(n) = n-1 for odd n. - _Dominic McCarty_, Mar 12 2025 %e A333470 a(1) = 1 steps over 1 comma to be met by the odd term 3; %e A333470 a(2) = 3 steps over 3 commas to be met by the odd term 5; %e A333470 a(3) = 2 steps over 2 commas to be met by the same odd term 5; %e A333470 a(4) = 4 steps over 4 commas to be met by the odd term 9 (the odd term 5 is closer, but this is not the point); %e A333470 a(5) = 5 steps over 5 commas to be met by the odd term 11 (again, the odd terms 7 and 9 are closer, but we don't care); etc. %o A333470 (Python) def a(n): return n if len(bin(n))%2 else n-1 if n%2 else n+1 # _Dominic McCarty_, Mar 12 2025 %K A333470 base,nonn %O A333470 1,2 %A A333470 _Eric Angelini_ and _Carole Dubois_, Mar 23 2020