# Sum preserving transformations of square symmetric matrices with natural elements

Suppose I have a matrix $$A = [a_{ij}]_{n\times n}$$ such that $$a_{ij} \in \mathbb{N}$$ and $$a_{ij}=a_{ji}$$. I want to transform this matrix such that the sum $$\sum_{i,j}a_{ij}$$ remains constant, symmetry is maintained, and the resultant matrix also comprises natural numbers. Identity transformation is one example of such a transformation.

If we define the operator $$\sum$$ as $$\sum A = \sum_{i,j}a_{ij}$$, then $$\sum (AT) = \sum A$$ or $$\sum (TA) = \sum A$$.

### Examples

1. Identity transform.
2. Subtract a number less than or equal to $$a_{ij}$$ or $$a_{ji}$$ from $$a_{ij}$$ and $$a_{ji}$$ and add it to $$a_{kl}$$ and $$a_{lk}$$ for arbitrary indices.
3. Swapping of diagonal elements: $$a_{ii}\to a_{jj}$$ and $$a_{jj}\to a_{ii}$$.

I am wondering if there is a general formulation for such transformations, possibly in matrix form. And could someone provide insight into left and right transforms?