The most common formula for generating Pythagorean triples is Euclid's, shown here as $$A=m^2-k^2\qquad B=2mk\qquad C=m^2+k^2$$ It generates all primitves but also generates trivals, doubles, square multiples, and doubles of square multiples of primitives. A variation of this is
\begin{align*} &A=(2n-1+k)^2-k^2&&=(2n-1)^2+2(2n-1)k\\ &B=2(2n-1+k)k &&=\phantom{(2n-1)^2+{}} 2(2n-1)k+2k^2\\ &C=(2n-1+k)^2+k^2 &&=(2n-1)^2+2(2n-1)k+2k^2 \end{align*} It generates no trivials and all primitives but also generates odd square multiples of primitives.
In the latter, if we let $\,n=1\implies \big(A=2k+1\quad B=2k^2 + 2k\quad C=2 k^2 + 2 k + 1\big),\,$ or $\,k-1\implies \big(A=4n^2-1\quad B=4n\quad C=4n^2+1\big)$ we get only primitives but not all primitives.
Is there a formula that genrates only and all primitives besides the one that generates the ternary tree? I doubt such a formula exists but I would love to see it if it does.