|
|
A246678
|
|
Permutation of natural numbers: a(1) = 1, a(2n+1) = 1 + 2*a(n), a(2n) = A242378(A001511(n), (1+A000265(n))) - 1.
|
|
6
|
|
|
1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 11, 24, 17, 26, 15, 10, 13, 20, 19, 34, 29, 44, 23, 48, 49, 32, 35, 124, 53, 80, 31, 12, 21, 74, 27, 54, 41, 62, 39, 76, 69, 38, 59, 174, 89, 134, 47, 120, 97, 50, 99, 64, 65, 98, 71, 342, 249, 104, 107, 624, 161, 242, 63, 16, 25, 56, 43, 244, 149, 224, 55, 90, 109, 68, 83
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
See the comments in A246676. This is a similar permutation, except for odd numbers, which are here recursively permuted by the emerging permutation itself. The even bisection halved gives A246680, the odd bisection from a(3) onward with one subtracted and then halved gives this sequence back.
|
|
LINKS
|
|
|
FORMULA
|
a(1) = 1, a(2n+1) = 1 + 2*a(n), a(2n) = A242378(A001511(n), (1+A000265(n))) - 1. [Where the bivariate function A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n].
|
|
PROG
|
(Scheme, with memoization-macro definec)
(definec (A246678 n) (cond ((<= n 1) n) ((odd? n) (+ 1 (* 2 (A246678 (/ (- n 1) 2))))) (else (+ -1 (A242378bi (A007814 n) (+ 1 (A000265 n))))))) ;; Code for A242378bi given in A242378.
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|