login
Permutation of natural numbers: a(1) = 1, a(A270189(1+n)) = 2 * a(n), a(A270190(n)) = 1 + 2*a(n).
4

%I #7 Mar 25 2016 07:47:54

%S 1,2,4,8,16,32,64,128,3,256,5,6,512,10,9,17,12,33,1024,20,65,18,129,

%T 34,24,66,2048,40,130,36,258,257,68,48,132,7,513,4096,11,13,80,260,72,

%U 516,514,1025,21,136,96,264,19,14,1026,35,25,67,8192,2049,22,26,160,520,144,1032,1028,2050,41,42,272,192,131,528,37,259,38,69,28

%N Permutation of natural numbers: a(1) = 1, a(A270189(1+n)) = 2 * a(n), a(A270190(n)) = 1 + 2*a(n).

%H Antti Karttunen, <a href="/A270201/b270201.txt">Table of n, a(n) for n = 1..10001</a>

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

%F a(1) = 1, for n > 1, if A137264(n) = 0 [when n is in A270190], a(n) = 1 + 2*a(A269850(n)), otherwise a(n) = 2 * a(A269849(n)-1).

%o (Scheme, with memoization-macro definec)

%o (definec (A270201 n) (cond ((= 1 n) n) ((not (zero? (A137264 n))) (* 2 (A270201 (+ -1 (A269849 n))))) (else (+ 1 (* 2 (A270201 (A269850 n)))))))

%Y Inverse: A270202.

%Y Cf. A137264, A269849, A269850, A270189, A270190.

%Y Similar permutation: A270193.

%K nonn

%O 1,2

%A _Antti Karttunen_, Mar 16 2016