login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #7 Mar 03 2016 22:51:45

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

%T 65,18,35,512,21,24,31,22,129,20,27,1024,25,34,39,2048,29,4096,67,30,

%U 257,8192,47,28,513,26,131,16384,37,48,71,38,1025,40,43,32768,49,66,63,36,45,65536,259,46,41,131072,55,96,2049,130,51,262144,69,44

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

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

%H Antti Karttunen, <a href="/A269388/b269388.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(A269380(n)).

%F As a composition of other permutations:

%F a(n) = A252754(A269172(n)).

%F a(n) = A269378(A260742(n)).

%o (Scheme, with memoization-macro definec)

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

%Y Inverse: A269387.

%Y Cf. A269380.

%Y Related permutations: A260742, A269386, A269172.

%Y Cf. also A252754, A269378.

%Y Differs from A156552, A252754 and A246677(n-1) for the first time at n=19, which here a(19)=12, instead of 128.

%K nonn

%O 1,3

%A _Antti Karttunen_, Mar 01 2016