`\frac{n(n+1)}{2}` came out as `(n(n+1))/2` and the quadratic formula
as a wall of parentheses, because the test was "is this operand a
single token" rather than "would the slash change what this means".
Brackets now appear in exactly two cases: a sum, where the slash would
otherwise divide only the last term, and a denominator that is more
than one term, where `1/2a` is read two ways. `n(n+1)/2`, `√π/2` and
`mc²/√(1 − v²/c²)` need nothing, while `1 / (2a)` and
`(−b ± √(b² − 4ac)) / (2a)` keep their brackets. A script is read
through rather than counted, since a sum above the line is unambiguous
by construction.
The slash is spaced only when something beside it is bracketed, which
is where the brackets would otherwise crowd it.