Finding a specific "balls-into-bins" partition given its index in the lexicographical ordering
The procedure of generating the $i$-th structure according to some ordering of a combinatorial class is called unranking.

In your specific case an unranking algorithm for $P_{n,k}(i)$ can be created as follows:

Define $s_m := \sum_{j=0}^m |P_{n-j,k-1}|$, the number of vectors that start with $m$ or a smaller number, $s_{-1}=0$.


If $k=1$, the vector contains the single entry $n$. 
Otherwise,

The first entry in the vector is $m$ so that $s_{m-1} &lt; i \le s_m$.
The remaining vector is $P_{n-m,k-1}(i-s_{m-1})$.