[go: up one dir, main page]

login
Permutation of natural numbers: a(1) = 1, a(A269389(1+n)) = 2 * a(n), a(A269399(n)) = 1 + 2*a(n).
6

%I #11 Mar 25 2016 23:00:50

%S 1,2,3,4,5,6,8,10,7,9,12,11,16,20,13,14,17,18,24,22,32,40,26,28,34,21,

%T 36,48,44,15,19,64,25,23,80,52,56,68,42,33,41,72,96,88,27,30,38,29,35,

%U 37,128,49,50,46,160,104,112,136,84,66,45,82,144,192,65,176,81,53,54,57,60,76,58,70,74,256,98,69,100,43,92

%N Permutation of natural numbers: a(1) = 1, a(A269389(1+n)) = 2 * a(n), a(A269399(n)) = 1 + 2*a(n).

%H Antti Karttunen, <a href="/A270193/b270193.txt">Table of n, a(n) for n = 1..10001</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F a(1) = 1, for n > 1, if A137264(6+n) = 0 [when n is in A269399], a(n) = 1 + 2*a(n-A269362(n)), otherwise a(n) = 2 * a(A269362(n)-1).

%o (Scheme, with memoization-macro definec)

%o (definec (A270193 n) (cond ((= 1 n) n) ((not (zero? (A137264 (+ 6 n)))) (* 2 (A270193 (+ -1 (A269362 n))))) (else (+ 1 (* 2 (A270193 (- n (A269362 n))))))))

%Y Inverse: A270194.

%Y Cf. A137264, A269362, A269389, A269399.

%Y Similar permutations: A270199, A270201 (compare the scatter plots).

%K nonn,look

%O 1,2

%A _Antti Karttunen_, Mar 16 2016