1,3

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

Antti Karttunen, Table of n, a(n) for n = 1..1024

Index entries for sequences that are permutations of the natural numbers

a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A269380(2n+1)).

As a composition of related permutations:

a(n) = A252756(A269172(n)).

a(n) = A269376(A260742(n)).

(Scheme, with memoization-macro definec)

(definec (A269386 n) (cond ((<= n 2) (- n 1)) ((even? n) (* 2 (A269386 (/ n 2)))) (else (+ 1 (* 2 (A269386 (A269380 n)))))))

Inverse: A269385.

Cf. A269380.

Related permutations: A260742, A269172, A269388.

Cf. also A252756, A269376.

Differs from A243071 and A252756 for the first time at n=19, which here a(19) = 11, instead of 255.

Sequence in context: A014841 A056476 A056481 * A252756 A243071 A332811

Adjacent sequences: A269383 A269384 A269385 * A269387 A269388 A269389

nonn

Antti Karttunen, Mar 01 2016

approved