Find the number of ways 66 coins can be distributed in 3 non empty piles second pile has more than first and third has more than second Let the coins in each pile be $x_1,x_2,x_3$
so $x_1+x_2+x_3=66$
Also let $x_2-x_1=a, x_3-x_2 = b, x_3-x_1=c$
So we get $3a+2b+c=66$ where $a,b,c>0$
Now how do I find number of ways from this?
 A: Assuming coins are identical and heaps are ordered, as heaps have to be non-empty, we first place $1$ coin in each heap. That leaves us with $63$ coins.
We first find number of ways that any two or all three heaps have the same number of coins. There are $32$ ways for any two heaps to have the same number of coins ($1, 1$ to $32, 32$). But note that one of them is where all $3$ heaps have the same number of coins ($22, 22, 22$).
So number of ways in which no two heaps have same number of coins -
$\displaystyle {63 + 3 - 1 \choose 3-1} - {3 \choose 2} \cdot 31 - 1 = 1986$
Now there are $3!$ ways to order heaps and we are interested in only one of those orders - second heap having more coins than the first and third having more coins than the second. So the answer should be,
$ \displaystyle \frac{1986}{3!} = 331$
A: It is said that all  piles are non empty , and $x_1<x_2<x_3$ where they represent the number of coins in piles. Hence ,  we can write them such that $(x_2 = x_1 +a)$ , $(x_3=x_2 + b=x_1 +a+b)$ where $a,b$ are positive integers to satify the inequalities. (Moreover , $x_1,x_2,x_3$ are also positive integer , because the piles are nonempty)
Then , $x_1 +x_2 +x_3 = 3x_1 +2a +b$ where $x_1 ,a,b$ are positive integers.
Then , $3x_1 = 3,6,9,12..$ , $2a=2,4,6,8,...$  , $b=1,2,3,4,..$ when $a,b,x_1$ are positive integers like $1,2,3,...$
Now , we can make use of ggenerating functions to solve it.
Genereating function of  $3x_1 = 3,6,9,12..$ is $\frac{x^3}{1-x^3}$
Genereating function of  $2a=2,4,6,8,...$ is $\frac{x^2}{1-x^2}$
Genereating function of $b=1,2,3,4,..$ is $\frac{x}{1-x}$
At last , find the coeffient of $x^{66}$ in the expansion of $$\frac{x}{1-x} \times \frac{x^2}{1-x^2} \times \frac{x^3}{1-x^3}$$
Such that https://www.wolframalpha.com/input/?i=expanded+form+of+%28x%5E3+%2F+%281-x%5E3%29%29++%28x%5E2+%2F+%281-x%5E2%29%29++%28x+%2F+%281-x%29%29
As you see , the coefficient of $x^{66}$ is $331$
NOTE = I assumed that all coins are identical and the piles are different.
