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 A246210 #19 May 02 2021 11:08:21 %S A246210 0,1,3,6,12,2,13,7,25,50,100,14,28,56,200,4,26,24,101,51,201,27,5,15, %T A246210 57,29,113,226,452,58,116,232,904,30,114,10,20,40,228,456,912,80,1808, %U A246210 60,464,48,202,52,402,54,102,400,8,112,453,227,905,115,31,59,233,117,465,203,49,103,9,401,53,55,403,11,41,21,81,61 %N A246210 Permutation of nonnegative integers: a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 1, a(n) = 1 + 2*a(-(A117966(n))), otherwise a(n) = 2*a(A117966(n)-1). %C A246210 This is an instance of entanglement permutation, where complementary pair A117967/A117968 (positive and negative part of inverse of balanced ternary enumeration of integers, respectively) is entangled with complementary pair A005843/A005408 (even and odd numbers respectively), with a(0) set to 0 and a(1) set to 1. %C A246210 This implies that apart from a(1) = 1, even numbers occur only in positions given by A117967, and odd numbers only in positions given by A117968. %H A246210 Antti Karttunen, <a href="/A246210/b246210.txt">Table of n, a(n) for n = 0..2187</a> %H A246210 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A246210 a(0) = 0, a(1) = 1, and for n > 1, if A117966(n) < 1, a(n) = 1 + 2*a(-(A117966(n))), otherwise a(n) = 2*a(A117966(n)-1). %F A246210 As a composition of related permutations: %F A246210 a(n) = A054429(A246208(n)). %F A246210 a(n) = A246208(A246211(n)). %o A246210 (Scheme, with memoizing definec-macro from _Antti Karttunen_'s IntSeq-library) %o A246210 (definec (A246210 n) (cond ((<= n 1) n) ((negative? (A117966 n)) (+ 1 (* 2 (A246210 (- (A117966 n)))))) (else (* 2 (A246210 (- (A117966 n) 1)))))) %o A246210 (Python) %o A246210 def a117966(n): %o A246210 if n==0: return 0 %o A246210 if n%3==0: return 3*a117966(n//3) %o A246210 elif n%3==1: return 3*a117966((n - 1)//3) + 1 %o A246210 else: return 3*a117966((n - 2)//3) - 1 %o A246210 def a(n): %o A246210 if n<2: return n %o A246210 x=a117966(n) %o A246210 if x<1: return 1 + 2*a(-x) %o A246210 else: return 2*a(x - 1) %o A246210 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 07 2017 %Y A246210 Inverse: A246209. %Y A246210 Similar or related permutations: A054429, A246208, A246211. %Y A246210 Cf. A005408, A005843, A117966, A117967, A117968. %K A246210 nonn %O A246210 0,3 %A A246210 _Antti Karttunen_, Aug 19 2014