Solution (source code)

= Solution

Normalize the <cubic anomaly coefficient> of the $SU(N)$ fundamental to $+1$. The <two-index antisymmetric representation> has anomaly coefficient $N-4$, while an antifundamental contributes $-1$. Cancellation of the $SU(N)^3$ <gauge anomaly> requires
$$
(N-4)-p=0,
\qquad
\boxed{p=N-4}.
$$