login

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

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

%I #7 Mar 15 2016 00:16:57

%S 1,2,3,4,7,6,5,8,13,14,15,12,17,10,25,16,11,26,9,28,21,30,27,24,57,34,

%T 53,20,31,50,49,32,101,22,35,52,65,18,29,56,51,42,105,60,69,54,23,48,

%U 85,114,97,68,19,106,121,40,37,62,43,100,33,98,229,64,55,202,197,44,405,70,115,104,89,130,209,36,107,58,261,112,61

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

%H Antti Karttunen, <a href="/A270196/b270196.txt">Table of n, a(n) for n = 1..8191</a>

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

%F a(1) = 1, after which for even n, a(n) = 2*a(n/2), for odd n, a(n) = 1 + 2*a(A269370(n)-1).

%o (Scheme, with memoization-macro definec)

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

%Y Inverse: A270195.

%Y Cf. A269369, A269370.

%Y Related or similar permutations: A269866, A269373, A269376, A270197.

%K nonn

%O 1,2

%A _Antti Karttunen_, Mar 13 2016