I would like to determine the sparsity pattern of a matrix $A_m$, where the entry $(k,l)$ of $A_m$ is non-zero if the condition $\operatorname{test}(k,l,m)$ is true:
$\operatorname{test}(k,l,m)$ = "The sum $k+l+m$ is even ($mod(k+l+m,2)=0$) and the sum of any two integers is not smaller that the third one (i.e. $k+l \geq m$ and $k+m \geq l$ and $l+m \geq k$)."
Note that $q(k,l,m)$ is invariant by permutation of its entries.
For a given $m$, can we determine in advance the sparsity pattern of $A_m$ without looping over all the entries?