Question about the partitions of a natural number

There is a function that counts the number of partitions of with $n$ digits?

I am aware of the partition function studied by Ramanujan, but what I want is a subset of the partitions that are counted by that function.

What I want is a function $p_k(n) =$ # of different partitions in $k$ integers

Example:

5 can be partitioned as

5
4 + 1
3 + 2
2 + 2 + 1
3 + 1 + 1
2 + 1 + 1 + 1
1 + 1 + 1 + 1 + 1

So for me, $p_1(5) = 1, p_2(5) = 2, p_3(5) = 2, p_4(5) = 1, p_5(5) = 1$

In general the function must satisfy that $p_1(n) = 1$ and $p_n(n) = 1$

That function even exists? or there is a sage or a general algorithm to compute that ?

• What do you mean by "of with $n$ digits"? – Robert Israel May 6 '18 at 19:53
• You distinguish $2+1+1+1$ and $1+1+1+2$? – Lord Shark the Unknown May 6 '18 at 19:53
• @LordSharktheUnknown typo sorry – Richard Clare May 6 '18 at 19:57

If $p_k(n)$ is the number of partitions of $n$ into exactly $k$ parts, then there is a generating function $$\sum_{n=k}^\infty p_k(n)t^n=\frac{t^k}{(1-t)(1-t^2)\cdots(1-t^k)}$$ for each $k$. Each of these may be expanded into partial fractions, and for each $k$ there is therefore an explicit formula for the $p_k(n)$ in terms of $n$.