Take the tree cells and find where d is between
Use i, j and c of those elements as an estimate of the nontrivial factorization of c. Put them together for the tree cells and you will see a pattern. For the values that are divided by two, take note of the power of 2 you removed. Think of it like a cell where every value is an estimate and you use c to make the estimate progressively better (log n time, same as our integer sqrt function).
The results can give you enough information to calculate where the right n for c must be.