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.
LINKS
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