[go: up one dir, main page]

login
A246677
Permutation of natural numbers: a(1) = 1, a(2n) = A000079(A055396(2n+1)-1) * ((2*A246277(2n+1))-1), a(2n+1) = 1 + 2*a(n).
7
1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 17, 10, 15, 64, 13, 128, 19, 18, 33, 256, 23, 12, 65, 14, 35, 512, 21, 1024, 31, 26, 129, 20, 27, 2048, 257, 42, 39, 4096, 37, 8192, 67, 22, 513, 16384, 47, 24, 25, 50, 131, 32768, 29, 36, 71, 66, 1025, 65536, 43, 131072, 2049, 38, 63, 52, 53, 262144, 259, 74, 41
OFFSET
1,2
COMMENTS
See the comments in A246675. This is otherwise similar permutation, except for odd numbers, which are here recursively permuted by the emerging permutation itself. The even bisection halved gives A246679, the odd bisection from a(3) onward with one subtracted and then halved gives this sequence back.
FORMULA
a(1) = 1, a(2n) = A000079(A055396(2n+1)-1) * ((2*A246277(2n+1))-1), a(2n+1) = 1 + 2*a(n).
PROG
(Scheme, with memoization-macro definec)
(definec (A246677 n) (cond ((<= n 1) n) ((odd? n) (+ 1 (* 2 (A246677 (/ (- n 1) 2))))) (else (* (A000079 (- (A055396 (+ 1 n)) 1)) (-1+ (* 2 (A246277 (+ 1 n))))))))
CROSSREFS
Inverse: A246678. Variants: A246675, A246683.
Even bisection halved: A246679.
a(n) differs from A156552(n+1) for the first time at n=32, where a(32) = 26, while A156552(33) = 34.
Sequence in context: A246675 A269388 A252754 * A156552 A269383 A249813
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 01 2014
STATUS
approved