I know that there are $11$ terms in the expansion of $(x^5+x^4+x^3+x^2+x+1)^2$ . Moreover there are much related question about it when the elements are ordered without having any missing element.
My question will be about those which have "missing terms" . For example , the number of elements in the expansion of $(1+x+x^2+x^3+x^4+x^5+x^6)^3$ is equal to $19$. Then,
How many terms are there in the expansion of $(1+x+x^2+x^3+x^6)^3$ ? (Answer is $17$)
Is there any general method for those ?
For a second example :
How many terms are there in the expansion of $(1+x+x^2+x^6)^3$ ? (Answer is $15$)
Concisely , I am looking for the method which provide me to calculate the number of terms in the expansions which do not have ordered exponentials like $(0,1,2,3,4,...)$ etc.
I hope to find mathematical approach instead of offering worlfram alpha..