I have a tensor $A_{ijk}$ were indices $i$, $j$, and $k$ run from $1$ to $N$.
Obviously there are $N^3$ elements, but how many unique elements are there if the following symmetries exist?
- $A_{iij} = A_{iji} = A_{jii} $
- $A_{ijk} = A_{ikj} = A_{jik} = A_{jki} = A_{kij} = A_{kji}$
These are all the symmetries that would exist with differentiation, since this tensor actually represents the third derivative of a function.
There are $N$ unique elements of the form $A_{iii}$.
For elements of the form $A_{iij}$, there are $N$ ways to choose $i$ and $N-1$ ways to choose $j$. Notice that order matters here.
For elements of the form $A_{ijk}$, there are $\binom{N}3$ ways to choose $i$, $j$ and $k$. Notice that order does not matter here, which is why we used the binomial coefficient here (and not in the previous case).
This gives us $N + N(N-1) + N(N-1)(N-2)/6 = \frac16(n^3+3n^2+2n)$.