login
A269386
Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A269380(2n+1)).
6
0, 1, 3, 2, 7, 6, 15, 4, 5, 14, 31, 12, 63, 30, 13, 8, 127, 10, 11, 28, 9, 62, 255, 24, 511, 126, 29, 60, 1023, 26, 23, 16, 25, 254, 27, 20, 2047, 22, 61, 56, 4095, 18, 8191, 124, 17, 510, 16383, 48, 19, 1022, 21, 252, 32767, 58, 47, 120, 57, 2046, 55, 52, 65535, 46, 125, 32, 59, 50, 131071, 508, 49, 54, 262143, 40, 95, 4094, 253, 44
OFFSET
1,3
COMMENTS
Note the indexing: Domain starts from 1, range from 0.
FORMULA
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)).
PROG
(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)))))))
CROSSREFS
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: A056476 A056481 A366276 * A252756 A243071 A332811
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 01 2016
STATUS
approved