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”).

A269388
Permutation of natural numbers: a(1) = 0, after which, a(2n) = 1 + 2*a(n), a(2n+1) = 2 * a(A269380(n)).
10
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, 65, 18, 35, 512, 21, 24, 31, 22, 129, 20, 27, 1024, 25, 34, 39, 2048, 29, 4096, 67, 30, 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
OFFSET
1,3
COMMENTS
Note the indexing: Domain starts from 1, range from 0.
FORMULA
a(1) = 0, after which, a(2n) = 1 + 2*a(n), a(2n+1) = 2 * a(A269380(n)).
As a composition of other permutations:
a(n) = A252754(A269172(n)).
a(n) = A269378(A260742(n)).
PROG
(Scheme, with memoization-macro definec)
(definec (A269388 n) (cond ((= 1 n) (- n 1)) ((even? n) (+ 1 (* 2 (A269388 (/ n 2))))) (else (* 2 (A269388 (A269380 n))))))
CROSSREFS
Inverse: A269387.
Cf. A269380.
Related permutations: A260742, A269386, A269172.
Cf. also A252754, A269378.
Differs from A156552, A252754 and A246677(n-1) for the first time at n=19, which here a(19)=12, instead of 128.
Sequence in context: A246684 A249812 A246675 * A252754 A246677 A156552
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 01 2016
STATUS
approved