login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Permutation of natural numbers: a(1) = 0, after which a(2n) = 1 + 2*a(n), a(2n+1) = 2 * a(A269370(n)).
4

%I #7 Mar 07 2016 12:24:07

%S 0,1,2,3,6,5,4,7,8,13,10,11,16,9,32,15,14,17,12,27,64,21,26,23,128,33,

%T 24,19,22,65,256,31,512,29,18,35,1024,25,20,55,30,129,2048,43,48,53,

%U 34,47,4096,257,8192,67,54,49,96,39,40,45,42,131,28,513,16384,63,46,1025,32768,59,65536,37,66,71,131072,2049,262144,51,38,41

%N Permutation of natural numbers: a(1) = 0, after which a(2n) = 1 + 2*a(n), a(2n+1) = 2 * a(A269370(n)).

%C Note the indexing: Domain starts from 1, range from 0.

%H Antti Karttunen, <a href="/A269378/b269378.txt">Table of n, a(n) for n = 1..1024</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F a(1) = 0, after which, a(2n) = 1 + 2*a(n), a(2n+1) = 2 * a(A269370(n)).

%F As a composition of related permutations:

%F a(n) = A269388(A260741(n)).

%o (Scheme, with memoization-macro definec)

%o (definec (A269378 n) (cond ((= 1 n) (- n 1)) ((even? n) (+ 1 (* 2 (A269378 (/ n 2))))) (else (* 2 (A269378 (A269370 n))))))

%Y Inverse: A269377.

%Y Cf. A269370.

%Y Related permutation: A269376.

%Y Cf. also A252754, A269388.

%K nonn

%O 1,3

%A _Antti Karttunen_, Mar 01 2016