Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #28 Jul 19 2021 01:20:52
%S 1,3,2,4,8,9,5,7,10,18,16,37,21,15,43,75,33,36,20,14,11,19,17,34,38,
%T 22,29,41,73,66,150,86,31,172,300,132,147,83,59,44,76,68,35,39,6,13,
%U 79,71,136,152,88,119,167,295,264,600,344,62,173,301,133,146,82
%N Permutation of the positive integers related to the "Sine tree" (see Comments lines for construction details).
%C The "Sine tree" is constructed according to this procedure:
%C take an infinite complete binary tree,
%C initially, the nodes have no value,
%C for each n=1,2,3,...:
%C move to the root node,
%C while the current node has a value:
%C if sin(n)<sin(node.value) then move to the left child node,
%C else move to the right child node.
%C assign the value n to the current node.
%C As the set {sin(1), sin(2), sin(3), ...} is dense in the open interval ]-1, +1[, each node will eventually have a value.
%C a(n) corresponds to the "index" of the node with value n:
%C - the index of the root node is 1,
%C - the index of the left child of the node with index k is 2*k,
%C - the index of the right child of the node with index k is 2*k+1.
%C a(A046959(n)) = 2^(n-1)-1, for any n>1.
%C a(A046964(n)) = 2^(n-1), for any n>0.
%H Paul Tek, <a href="/A228784/b228784.txt">Table of n, a(n) for n = 1..10000</a>
%H Paul Tek, <a href="/A228784/a228784.png">The 7 first nodes of the Sine tree</a>
%H Paul Tek, <a href="/A228784/a228784.txt">Perl program for this sequence</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e For n=1: the root node has no value, so we assign it the value 1, and a(1)=1.
%e For n=2: the root node has value 1, and sin(2)>sin(1), so we move to the right child node. This node has no value, so we assign it the value 2, and a(2)=2*1+1.
%e For n=3: the root node has value 1, and sin(3)<sin(1), so we move to the left child node. This node has no value, so we assign it the value 3, and a(3)=2*1.
%o (Perl) See Links section.
%Y Cf. A046959, A046964, A229976.
%K nonn,look
%O 1,2
%A _Paul Tek_, Oct 04 2013