login
A269391
Permutation of natural numbers: a(1) = 1, a(A233271(1+n)) = 2*a(n), a(A269390(n)) = 1 + 2*a(n), where A233271 is the infinite trunk of inverted binary beanstalk and A269390 is its complement.
6
1, 2, 3, 4, 5, 7, 6, 8, 9, 11, 15, 10, 13, 17, 14, 12, 19, 23, 31, 21, 16, 27, 35, 18, 29, 25, 39, 22, 47, 63, 30, 20, 43, 33, 55, 71, 37, 26, 59, 51, 79, 34, 45, 95, 127, 28, 61, 41, 24, 87, 67, 111, 38, 143, 75, 46, 53, 119, 103, 62, 159, 69, 42, 32, 91, 191, 255, 57, 123, 83, 54, 49, 175, 135, 70, 223, 77, 287, 36
OFFSET
1,2
FORMULA
a(1) = 1, for n > 1, if A269381(n) - A269381(n-1) > 0 [when n is in A233271] a(n) = 2*a(A269381(n)-1), otherwise a(n) = 1 + 2*a(n-A269381(n)).
As a composition of other permutations:
a(n) = A269401(A269397(n)).
PROG
(Scheme, with memoization-macro definec)
(definec (A269391 n) (cond ((<= n 1) n) ((zero? (- (A269381 n) (A269381 (- n 1)))) (+ 1 (* 2 (A269391 (- n (A269381 n)))))) (else (* 2 (A269391 (+ -1 (A269381 n)))))))
CROSSREFS
Inverse: A269392.
Cf. also A260431.
Similar or related permutations: A269397, A269401.
Sequence in context: A359752 A267111 A161919 * A095903 A267112 A269392
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Mar 05 2016
STATUS
approved