A pyramid number:
0
1 2
3 4 5
6 7 8 9
So is there any equation like:
right(0) -> 2
right(2) -> 5
right(5) -> 9
right(1) -> 4
right(4) -> 8
right(3) -> 7
A pyramid number:
0
1 2
3 4 5
6 7 8 9
So is there any equation like:
right(0) -> 2
right(2) -> 5
right(5) -> 9
right(1) -> 4
right(4) -> 8
right(3) -> 7
Copyright © 2021 JogjaFile Inc.
Hint: Yes, there is such function. If $$\frac{x(x-1)}{2}\leq y<\frac{x(x+1)}{2}$$ then the number is on the $x+1$th row and is the right child $x+2$ bigger. Now find the inverse of the above. Hint: Use a floor function.