https://www.jsoftware.com/papers/tot.htm
Might be a different notation needed depending on the subject.