The code below used to work, but now I am getting an error (out of stack space).
The code calculates ownership percentages up an ownership tree.
For instance:
Company 11394 is owned 75% by 10528 and 25% by 50729.
Company 10528 is owned 25% by 37124, 25% by 21133 and 50% by 11488.
Company 50729...