* parentof(i) returns nil if i == 0
* results are verified for sorting order