login
A269398
Permutation of natural numbers: a(1) = 1, a(A179016(1+n)) = A233271(1+a(n)), a(A213713(n)) = A269390(a(n)), where A179016, A233271 are the infinite trunks of binary beanstalk and inverted binary beanstalk and A213713, A269390 are their complements.
4
1, 3, 2, 7, 6, 5, 4, 16, 13, 11, 15, 10, 9, 26, 12, 8, 22, 19, 49, 25, 18, 17, 38, 40, 20, 31, 14, 35, 30, 72, 46, 28, 39, 29, 24, 27, 57, 59, 87, 33, 47, 32, 23, 52, 45, 21, 103, 68, 71, 43, 58, 44, 60, 37, 41, 83, 186, 85, 123, 50, 69, 48, 82, 56, 36, 76, 53, 67, 34, 144, 128, 98, 101, 143, 65, 84, 66, 63, 86, 55, 106, 61, 118, 253, 42, 121, 169
OFFSET
1,2
FORMULA
a(1) = 1, for n > 1, if A213719(n) = 1 [when n is in A179016] a(n) = A233271(1+a(A269371(n)-1)), otherwise a(n) = 1 + A269390(a(n-A269371(n))).
As a composition of related permutations:
a(n) = A269392(A269401(n)).
PROG
(Scheme, with memoization-macro definec)
(definec (A269398 n) (cond ((<= n 1) n) ((zero? (A213719 n)) (A269390 (A269398 (- n (A269371 n))))) (else (A233271 (+ 1 (A269398 (+ -1 (A269371 n))))))))
CROSSREFS
Inverse: A269397
Related or similar permutations: A269392, A269401, A269402.
Cf. also A233270.
Sequence in context: A341335 A276343 A054429 * A269397 A267107 A126316
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Mar 05 2016
STATUS
approved