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 A269167 #11 Feb 23 2016 13:10:53 %S A269167 1,3,7,15,31,63,2,127,5,255,11,511,14,6,23,1023,29,13,47,2047,59,27, %T A269167 95,4095,4,126,62,30,119,55,191,8191,9,253,125,61,239,111,383,16383, %U A269167 19,507,251,123,479,223,767,32767,46,12,28,1022,22,510,39,254,1015,503,247,959,447,1535,10,65535,93,25,57,2045,45 %N A269167 Permutation of natural numbers: a(1) = 1, a(A269160(n)) = 2*a(n), a(A269164(n+1)) = 1+(2*a(n)). %H A269167 Antti Karttunen, <a href="/A269167/b269167.txt">Table of n, a(n) for n = 1..12285</a> %H A269167 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A269167 a(1) = 1, for n > 1, if A269162(n) > 0 [when n is in A269163], a(n) = 2*a(A269162(n)), otherwise [when n is in A269164], a(n) = 1 + 2*a(A269169(n)-1). %t A269167 terms = 100; A269160[n_] := BitXor[n, BitOr[2 n, 4 n]]; f[max_] := f[max] = (s = Sort[Table[A269160[n], {n, 0, max}]]; Complement[Range[Last[s]], s][[1 ;; terms]]); f[terms]; f[max = 2 terms]; While[f[max] != f[max/2], max = 2 max]; A269164[n_] := f[max][[n]]; a[1]=1; eq[n_] := a[A269160[n]] == 2*a[n] && a[A269164[n+1]] == 1 + 2*a[n]; A269167 = Array[a, terms-1] /. Solve[Array[eq, terms-1]] // First (* _Jean-François Alcover_, Feb 23 2016 *) %o A269167 (Scheme, with memoization-macro definec) %o A269167 (definec (A269167 n) (cond ((= 1 n) n) ((not (zero? (A269162 n))) (* 2 (A269167 (A269162 n)))) (else (+ 1 (* 2 (A269167 (- (A269169 n) 1))))))) %Y A269167 Inverse: A269168. %Y A269167 Cf. A269160, A269162, A269163, A269164, A269169. %K A269167 nonn %O A269167 1,2 %A A269167 _Antti Karttunen_, Feb 21 2016