Assume $n=5$.
We have $p(n)=$
5
4 + 1
3 + 2
3 + 1 + 1
2 + 2 + 1
2 + 1 + 1 + 1
1 + 1 + 1 + 1 + 1
What I want to get is the number of partitions in which the maximum integer is $m$, for each $1\leq m \leq n$.
For the previous example, #5=1, #4=1, #3=2, #2=2, #1=1.
Can anybody help for the general case where $n$ is unknown? Thanks.
You will not find a simple formula for the quantity you want. If $P_m(n)$ is the number of partitions of $n$ for which the largest part is $m$, then you have $p(n)=\sum_{m=1}^n P_m(n)$, where $p(n)$ is the number of partitions of $n$. This would then give a nice formula for $p(n)$, but we know that this does not exist. You can check Wikipedia for a generating functions though.