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 A327093 #61 Jul 17 2023 15:17:36 %S A327093 2,3,7,5,11,13,15,10,17,19,23,25,27,21,40,16,35,36,39,37,58,33,47,50, %T A327093 52,43,45,34,59,78,63,31,76,55,82,67,75,57,99,56,83,112,87,61,126,69, %U A327093 95,92,97,96,133,71,107,81,142,79,139,91,119,155,123,93,122,51,151,146,135 %N A327093 Sequence obtained by swapping each (k*(2n))-th element of the positive integers with the (k*(2n-1))-th element, for all k > 0, in ascending order. %C A327093 Start with the sequence of positive integers [1, 2, 3, 4, 5, 6, 7, 8, ...]. %C A327093 Swap all pairs specified by k=1, that is, do the swaps (2,1),(4,3),(6,5),(8,7),..., resulting in [2, 1, 4, 3, 6, 5, 8, 7, ...], so the first term of the final sequence is 2 (No swaps for k>1 will affect this term). %C A327093 Swap all pairs specified by k=2, that is, do the swaps (4,2),(8,6),(12,10),(16,14),..., resulting in [2, 3, 4, 1, 6, 7, 8, 5, ...], so the second term of the final sequence is 3 (No swaps for k>2 will affect this term). %C A327093 Swap all pairs specified by k=3, that is, do the swaps (6,3),(12,9),(18,15),(24,21),... . %C A327093 Continue for all values of k. %C A327093 The complementary sequence 1, 4, 6, 8, 9, 12, 14, 18, 20, 22, 24, 26, 28, ... lists the numbers that never appear. Is there an alternative characterization of these numbers? %C A327093 Equivalently, is there a characterization of the numbers (2, 3, 5, 7, 10, 11, 13, 15, 16, 17, 19, 21, 23, ...) that do appear? - _N. J. A. Sloane_, Sep 13 2019 %H A327093 Jennifer Buckley, <a href="/A327093/b327093.txt">Table of n, a(n) for n = 1..10000</a> %o A327093 (Go) %o A327093 func a(n int) int { %o A327093 for k := n; k > 0; k-- { %o A327093 if n%k == 0 { %o A327093 if (n/k)%2 == 0 { %o A327093 n = n - k %o A327093 } else { %o A327093 n = n + k %o A327093 } %o A327093 } %o A327093 } %o A327093 return n %o A327093 } %o A327093 (SageMath) %o A327093 def a(n): %o A327093 for k in srange(n, 0, -1): %o A327093 if k.divides(n): %o A327093 n += k if is_odd(n//k) else -k %o A327093 return n %o A327093 print([a(n) for n in (1..67)]) # _Peter Luschny_, Sep 14 2019 %Y A327093 For the sorted terms and the missing terms see A327445, A327446. %Y A327093 Cf. A327119, A064494, A064627, A057032, A069829, A327420. %K A327093 nonn %O A327093 1,1 %A A327093 _Jennifer Buckley_, Sep 13 2019