I had posted a question about a pretty old permutation cipher here on Stack Overflow.
One @Mark Adler has commented that all possibilities of seven numbers with range $0$-$255$ in ascending order is $9,503,812,464$.
I tried to speculate by saying "Ok you mean each byte can be having value $0$-$255$ if first byte is $255$ then all others are also $255$. This is one way. If first byte is $254$ then there can be seven ways for remaining bytes ie $255,255,255,255,255,255$ or $254,255,255,255,255,255$ or $254,254,255,255,255,255$ or .... $254,254,254,254,254,254$ yes i seem to get it"
But I am not sure how to count all possibilities. Can anyone please help?
If $$0\le a_1\le a_2\le\cdots\le a_7\le255$$ then let $$b_0=a_1, b_1=a_2-a_1,b_2=a_3-a_2,\dots,b_6=a_7-a_6,b_7=255-a_7$$ and you have $$b_0+b_1+\cdots+b_7=255,\quad b_j\ge0.\tag1$$ Conversely, any solution of (1) gives you numbers $a_j$. So, do you know how to count the number of solutions of (1)?