login
Tree generated by the lucky numbers: a(1) = 1; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n+1)), where lucky = A000959, unlucky = A050505.
6

%I #25 Sep 09 2017 19:39:09

%S 1,2,3,4,7,5,9,6,21,11,13,8,31,14,15,10,87,29,37,17,49,19,25,12,141,

%T 42,51,20,63,22,33,16,517,112,133,40,189,50,69,24,259,64,75,27,111,35,

%U 43,18,925,177,211,56,267,66,79,28,339,83,93,30,159,45,67,23,4129,618,685,143,855,167,201,54,1275,234,261,65,391,90,105,34

%N Tree generated by the lucky numbers: a(1) = 1; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n+1)), where lucky = A000959, unlucky = A050505.

%C A permutation of the positive integers. See the comment at A183079.

%H Antti Karttunen, <a href="/A183089/b183089.txt">Table of n, a(n) for n = 1..512</a>

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

%F Let L(n) = A000959(n), the n-th lucky number.

%F Let U(n) = A050505(n), the n-th unlucky numbers.

%F The tree-array T(n,k) is then given by rows:

%F T(0,0) = 1; T(1,0) = 2;

%F T(n,2j) = L(T(n-1),j);

%F T(n,2j+1) = U(T(n-1),j);

%F for j = 0, 1, ..., 2^(n-1) - 1, n >= 2.

%F a(1) = 1; a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n+1)). - _Antti Karttunen_, May 09 2015

%e Top 6 levels of the binary tree:

%e 1

%e |

%e ...................2...................

%e 3 4

%e 7......../ \........5 9......../ \........6

%e / \ / \ / \ / \

%e / \ / \ / \ / \

%e / \ / \ / \ / \

%e 21 11 13 8 31 14 15 10

%e 87 29 37 17 49 19 25 12 141 42 51 20 63 22 33 16

%e ...

%e From the level 3 to the level 4: 3 --> (7,5) and 4 --> (9,6).

%o (Scheme, with memoizing definec-macro)

%o (definec (A183089 n) (cond ((<= n 1) n) ((even? n) (A050505 (A183089 (/ n 2)))) (else (A000959 (A183089 (/ (+ n 1) 2))))))

%o ;; _Antti Karttunen_, May 09 2015

%Y Inverse permutation: A257690.

%Y Cf. A000959, A050505.

%Y Cf. A257726 (similar permutation with a slightly different definition, resulting the first differing term at n=9, where a(9) = 21, while A257726(9) = 13), A257735 - A257738.

%Y Cf. A183079, A237739 (other similar permutations).

%K nonn,tabf

%O 1,2

%A _Clark Kimberling_, Dec 24 2010

%E Added a formula to the Name field and more terms, edited Example section - _Antti Karttunen_, May 09 2015