login
A228784
Permutation of the positive integers related to the "Sine tree" (see Comments lines for construction details).
2
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, 22, 29, 41, 73, 66, 150, 86, 31, 172, 300, 132, 147, 83, 59, 44, 76, 68, 35, 39, 6, 13, 79, 71, 136, 152, 88, 119, 167, 295, 264, 600, 344, 62, 173, 301, 133, 146, 82
OFFSET
1,2
COMMENTS
The "Sine tree" is constructed according to this procedure:
take an infinite complete binary tree,
initially, the nodes have no value,
for each n=1,2,3,...:
move to the root node,
while the current node has a value:
if sin(n)<sin(node.value) then move to the left child node,
else move to the right child node.
assign the value n to the current node.
As the set {sin(1), sin(2), sin(3), ...} is dense in the open interval ]-1, +1[, each node will eventually have a value.
a(n) corresponds to the "index" of the node with value n:
- the index of the root node is 1,
- the index of the left child of the node with index k is 2*k,
- the index of the right child of the node with index k is 2*k+1.
a(A046959(n)) = 2^(n-1)-1, for any n>1.
a(A046964(n)) = 2^(n-1), for any n>0.
EXAMPLE
For n=1: the root node has no value, so we assign it the value 1, and a(1)=1.
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.
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.
PROG
(Perl) See Links section.
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Paul Tek, Oct 04 2013
STATUS
approved