[go: up one dir, main page]

login
A269384
Permutation of natural numbers: a(1) = 1, a(n) = A255127(A001511(n), a(A003602(n))) - 1.
5
1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 15, 18, 13, 20, 11, 10, 17, 26, 27, 34, 29, 44, 35, 30, 25, 38, 39, 48, 21, 32, 19, 12, 33, 50, 51, 64, 53, 80, 67, 58, 57, 86, 87, 108, 69, 104, 59, 54, 49, 74, 75, 94, 77, 116, 95, 84, 41, 62, 63, 78, 37, 56, 23, 16, 65, 98, 99, 124, 101, 152, 127, 112, 105, 158, 159, 198, 133, 200
OFFSET
1,2
COMMENTS
Permutation obtained from the Ludic sieve.
This sequence can be represented as a binary tree. For n > 2, each left hand child is obtained by doubling the contents of the parent node and subtracting one, and each right hand child is obtained by applying A269382(n), when the parent node contains n:
1
|
...................2...................
3 4
5......../ \........8 7......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
9 14 15 18 13 20 11 10
17 26 27 34 29 44 35 30 25 38 39 48 21 32 19 12
etc.
FORMULA
a(1) = 1, a(n) = A255127(A001511(n), a(A003602(n))) - 1.
a(1) = 1, a(2n) = A269382(a(n)), a(2n+1) = (2*a(n+1))-1.
Other identities. For all n >= 0:
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]
PROG
(Scheme, two different implementations, both using memoization-macro definec)
(definec (A269384 n) (cond ((<= n 1) n) ((even? n) (A269382 (A269384 (/ n 2)))) (else (+ -1 (* 2 (A269384 (/ (+ n 1) 2)))))))
(definec (A269384 n) (cond ((<= n 1) n) (else (+ -1 (A255127bi (A001511 n) (A269384 (A003602 n))))))) ;; Code for A255127bi given in A255127.
CROSSREFS
Inverse: A269383.
Cf. also A269385, A269387 and also A249814, A269374.
Sequence in context: A249811 A246676 A246678 * A249814 A246684 A249812
KEYWORD
nonn,tabf
AUTHOR
Antti Karttunen, Mar 01 2016
STATUS
approved