login
Permutation of natural numbers: a(1) = 1, a(2n) = A005117(1+a(n)), a(2n+1) = A065642(1+a(n)).
4

%I #12 Sep 11 2025 18:52:02

%S 1,2,4,3,9,6,25,5,8,14,20,10,49,39,52,7,12,13,27,22,45,33,63,15,121,

%T 79,80,65,50,85,2809,11,16,19,169,21,28,42,56,35,529,73,92,55,68,103,

%U 128,23,32,199,244,130,100,131,243,106,132,82,153,139,172,4619,5620,17,18,26,289,31,40,277,340,34,44,43,841,69,1849,91,171,58,48

%N Permutation of natural numbers: a(1) = 1, a(2n) = A005117(1+a(n)), a(2n+1) = A065642(1+a(n)).

%C This sequence can be represented as a binary tree. Each left hand child is produced as A005117(1+n), and each right hand child as A065642(1+n), when the parent node contains n:

%C 1

%C ................../ \..................

%C 2 4

%C 3......../ \........9 6......../ \........25

%C / \ / \ / \ / \

%C / \ / \ / \ / \

%C / \ / \ / \ / \

%C 5 8 14 20 10 49 39 52

%C 7 12 13 27 22 45 33 63 15 121 79 80 65 50 85 2809

%C etc.

%C Compare to A285112.

%H Antti Karttunen, <a href="/A284572/b284572.txt">Table of n, a(n) for n = 1..166</a>

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

%F a(1) = 1, a(2n) = A005117(1+a(n)), a(2n+1) = A065642(1+a(n)).

%o (Scheme) ;; With memoization-macro definec.

%o (definec (A284572 n) (cond ((= 1 n) n) ((even? n) (A005117 (+ 1 (A284572 (/ n 2))))) (else (A065642 (+ 1 (A284572 (/ (- n 1) 2)))))))

%Y Inverse: A284571.

%Y Cf. A005117, A065642.

%Y Similar or related permutations: A243344, A243346, A277696, A285112.

%K nonn,tabf

%O 1,2

%A _Antti Karttunen_, Apr 17 2017