cp's OEIS Frontend

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.

A234612 Self-inverse permutation of nonnegative integers, "blue-gray" code: a(n) = A003188(A193231(n)).

This page as a plain text file.
%I A234612 #14 Jun 05 2017 17:36:44
%S A234612 0,1,2,3,7,6,5,4,8,9,10,11,15,14,13,12,25,24,27,26,30,31,28,29,17,16,
%T A234612 19,18,22,23,20,21,42,43,40,41,45,44,47,46,34,35,32,33,37,36,39,38,51,
%U A234612 50,49,48,52,53,54,55,59,58,57,56,60,61,62,63,127,126,125
%N A234612 Self-inverse permutation of nonnegative integers, "blue-gray" code: a(n) = A003188(A193231(n)).
%H A234612 Antti Karttunen, <a href="/A234612/b234612.txt">Table of n, a(n) for n = 0..8191</a>
%H A234612 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, section 1.19 "Invertible transforms on words", pp. 49--55 [Cf. especially the identity 1.19-9d: gB = Bg^{-1} given on page 53].
%H A234612 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A234612 a(n) = A003188(A193231(n)).
%F A234612 a(n) = A193231(A006068(n)).
%F A234612 a(n) = A193231(A234613(A193231(n))).
%o A234612 (Scheme)
%o A234612 (define (A234612 n) (A003188 (A193231 n)))
%o A234612 (define (A234612v2 n) (A193231 (A006068 n))) ;; Alternative 2.
%o A234612 (Python)
%o A234612 def a065621(n): return n^(2*(n - (n&-n)))
%o A234612 def a048724(n): return n^(2*n)
%o A234612 def a003188(n): return n^(n>>1)
%o A234612 def a193231(n):
%o A234612     if n<2: return n
%o A234612     if n%2==0: return a048724(a193231(n/2))
%o A234612     else: return a065621(1 + a193231((n - 1)/2))
%o A234612 def a(n): return n if n<2 else a003188(a193231(n)) # _Indranil Ghosh_, Jun 05 2017
%Y A234612 Cf. A003188, A006068, A193231, A234613, A234024-A234027.
%K A234612 nonn
%O A234612 0,3
%A A234612 _Antti Karttunen_, Dec 28 2013